Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileserver: Reject non-GET/HEAD requests (close #5166) #5167

Merged
merged 2 commits into from
Oct 24, 2022
Merged

Conversation

mholt
Copy link
Member

@mholt mholt commented Oct 24, 2022

File server does not mutate the files, so reject mutative methods. Accept only GET and HEAD (which is what the std lib ServeContent() knows).

@Saklad5
Copy link

Saklad5 commented Oct 24, 2022

Hold on, are you adding the Allow header as required?

The origin server MUST generate an Allow header field in a 405 response containing a list of the target resource's currently supported methods.

@mholt
Copy link
Member Author

mholt commented Oct 24, 2022

Yes, but the commit didn't get pushed.

@caddyserver caddyserver locked as resolved and limited conversation to collaborators Oct 24, 2022
@mholt mholt merged commit a3ae146 into master Oct 24, 2022
@mholt mholt deleted the methods branch October 24, 2022 16:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants