Skip to content

fix(cdn): reject unsupported HTTP methods#71

Open
Twest2 wants to merge 3 commits into
coollabsio:mainfrom
Twest2:fix/64-reject-unsupported-methods
Open

fix(cdn): reject unsupported HTTP methods#71
Twest2 wants to merge 3 commits into
coollabsio:mainfrom
Twest2:fix/64-reject-unsupported-methods

Conversation

@Twest2
Copy link
Copy Markdown

@Twest2 Twest2 commented Apr 24, 2026

Fixes #64.

Summary

This change rejects unsupported HTTP methods with 405 Method Not Allowed instead of serving static files for methods like POST.

Changes

  • Add a method gate in handleRequest() before file lookup or redirects.
  • Return 405 for methods other than GET, HEAD, and OPTIONS.
  • Add a regression test for POST /releases.json.
  • Document the new request flow in CLAUDE.md.

Validation

  • docker build -t coolify-cdn-issue-64 .
  • curl -X POST http://localhost:18081/releases.json now returns 405
  • curl -I http://localhost:18081/releases.json still returns 200

@Twest2 Twest2 changed the title fix(cdn): reject unsupported HTTP methods (#64) fix(cdn): reject unsupported HTTP methods Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Static file handler returns 200 for POST despite only advertising GET, HEAD, OPTIONS

2 participants