azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
3.1k stars 112 forks source link

[BUG]: "patch" method is prohibited in Cosmos middleware #90

Closed k00lagin closed 10 months ago

k00lagin commented 12 months ago

What happened?

Some third-party selfhosted services (like Pocketbase) rely on PATCH requests, which are not allowed by Cosmos middleware. So when app tries to use such request it fails due to MethodDisallowedByPreflightResponse error.

What should have happened?

Patch requests should be passed through middleware as any other requests.

How to reproduce the bug?

  1. Go to any service working through Cosmos
  2. Open Devtools on the Network tab
  3. Examine response headers of any random request to the service itself
  4. Find header Access-Control-Allow-Methods
  5. See that the list of methods is restricted to "GET, POST, PUT, DELETE, OPTIONS"

Relevant log output

No response

Other details

No response

System details

azukaar commented 12 months ago

Good catch thanks will fix

azukaar commented 10 months ago

Fixed