usememos / memos

An open source, lightweight note-taking service. Easily capture and share your great thoughts.
https://usememos.com
MIT License
28.57k stars 2.13k forks source link

fix: PATCH requests on /api/v1 not working #3600

Closed mudkipme closed 1 week ago

mudkipme commented 1 week ago

Because of https://github.com/soheilhy/cmux/issues/99, PATCH requests can't be handled by Memos v1 API (0.22+). Thankfully, cmux has a parameter to add supported HTTP methods for cmux.HTTP1Fast.

With some user agents and reverse proxy servers, this issue can't be reproduced because the PATCH request reused previous HTTP connections which were used by GET or POST requests, and didn't go through the match process of cmux.

This patch (pun intended) also fixes #3494, https://github.com/mudkipme/MoeMemosAndroid/issues/187 and https://github.com/mudkipme/MoeMemos/issues/189.