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

net/http: FileServer handles methods it does not understand #53501

Open
pascaldekloe opened this issue Jun 22, 2022 · 3 comments
Open

net/http: FileServer handles methods it does not understand #53501

pascaldekloe opened this issue Jun 22, 2022 · 3 comments

Comments

@pascaldekloe
Copy link
Contributor

@pascaldekloe pascaldekloe commented Jun 22, 2022

A DELETE gets served happily with HTTP 200 (OK) for example. The status code should be HTTP 405 (Method Not Allowed) instead, including an Allow: GET, HEAD.

The issue applies to Go versions up to 1.19 beta.

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 22, 2022

Change https://go.dev/cl/413554 mentions this issue: net/http: FileServer method check + minimal OPTIONS implementation

@jacobishao
Copy link
Contributor

@jacobishao jacobishao commented Jun 23, 2022

do you mean that it's HTTP 200 is only used for mehod GET and HEAD?

@pascaldekloe
Copy link
Contributor Author

@pascaldekloe pascaldekloe commented Jun 23, 2022

HTTP 200 on a DELETE means that the resource (file) has been removed @jacobishao.

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

No branches or pull requests

3 participants