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

Closed
pascaldekloe opened this issue Jun 22, 2022 · 7 comments
Closed

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

pascaldekloe opened this issue Jun 22, 2022 · 7 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@pascaldekloe
Copy link
Contributor

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

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

@jacobishao
Copy link
Contributor

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

@pascaldekloe
Copy link
Contributor Author

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

@dr2chase
Copy link
Contributor

dr2chase commented Jul 1, 2022

@neild can you give this and the corresponding CL a look? It looks plausible to me but IANAE.

@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 1, 2022
@dr2chase
Copy link
Contributor

dr2chase commented Jul 1, 2022

Or perhaps @rsc could give it a look?

@neild neild self-assigned this Jul 6, 2022
@neild neild removed their assignment Aug 1, 2022
@seankhliao seankhliao added this to the Unplanned milestone Aug 20, 2022
@gopherbot
Copy link

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

gopherbot pushed a commit that referenced this issue Apr 6, 2023
…ation"

This reverts https://go.dev/cl/413554

Reason for revert: Backwards-incompatible change in behavior.

For #53501
For #59375

Change-Id: Ic3f63b378f9c819599b32e5e6e410f6163849317
Reviewed-on: https://go-review.googlesource.com/c/go/+/482635
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@gopherbot
Copy link

Change https://go.dev/cl/488635 mentions this issue: [release-branch.go1.20] Revert "net/http: FileServer method check + minimal OPTIONS implementation"

gopherbot pushed a commit that referenced this issue Apr 25, 2023
…inimal OPTIONS implementation"

This reverts https://go.dev/cl/413554

Reason for revert: Backwards-incompatible change in behavior.

For #53501
For #59375
Fixes #59469

Change-Id: Ic3f63b378f9c819599b32e5e6e410f6163849317
Reviewed-on: https://go-review.googlesource.com/c/go/+/482635
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit c02fa75)
Reviewed-on: https://go-review.googlesource.com/c/go/+/488635
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
bradfitz pushed a commit to tailscale/go that referenced this issue May 25, 2023
…inimal OPTIONS implementation"

This reverts https://go.dev/cl/413554

Reason for revert: Backwards-incompatible change in behavior.

For golang#53501
For golang#59375
Fixes golang#59469

Change-Id: Ic3f63b378f9c819599b32e5e6e410f6163849317
Reviewed-on: https://go-review.googlesource.com/c/go/+/482635
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit c02fa75)
Reviewed-on: https://go-review.googlesource.com/c/go/+/488635
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
bradfitz pushed a commit to tailscale/go that referenced this issue May 25, 2023
…inimal OPTIONS implementation"

This reverts https://go.dev/cl/413554

Reason for revert: Backwards-incompatible change in behavior.

For golang#53501
For golang#59375
Fixes golang#59469

Change-Id: Ic3f63b378f9c819599b32e5e6e410f6163849317
Reviewed-on: https://go-review.googlesource.com/c/go/+/482635
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit c02fa75)
Reviewed-on: https://go-review.googlesource.com/c/go/+/488635
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants