]> Cypherpunks repositories - gostls13.git/commit
net/http: handle MethodNotAllowed
authorJonathan Amsterdam <jba@google.com>
Fri, 15 Sep 2023 16:17:15 +0000 (12:17 -0400)
committerJonathan Amsterdam <jba@google.com>
Fri, 15 Sep 2023 17:51:17 +0000 (17:51 +0000)
commit6192f4615514a7673fb2318ce3491e162d74d438
treea661db5437a51c6379d824ea7b79a2410d6ad32c
parent11b08a75cd6b93473d0ab6e4b6a94247ee341a01
net/http: handle MethodNotAllowed

If no pattern matches a request, but a pattern would have
matched if the request had a different method, then
serve a 405 (Method Not Allowed), and populate the
"Allow" header with the methods that would have succeeded.

Updates #61640.

Change-Id: I0ae9eb95e62c71ff7766a03043525a97099ac1bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/528401
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/net/http/request_test.go
src/net/http/routing_tree.go
src/net/http/routing_tree_test.go
src/net/http/server.go