You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using routing enhancements introduced in go 1.22 and registering a POST and a GET handlers on the same route with a wildcard matching all segments at the end of the route, the router gets confused when processing a request which doesn't have any segments for the wildcard, and calls a handler for the wrong method.
Example: https://go.dev/play/p/BTJeqbNMFbv
What did you see happen?
2009/11/10 23:00:00 Unexpected GET handler has been called
2009/11/10 23:00:00 Expected status code to be 200, but got 400
What did you expect to see?
I expected a handler for the POST route to be called and to see
"Test passed"
The text was updated successfully, but these errors were encountered:
/test gets redirected to /test/, with a redirect code that changes the method to GET.
closing as working as intended.
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
Go version
go version go1.23.3 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
When using routing enhancements introduced in go 1.22 and registering a POST and a GET handlers on the same route with a wildcard matching all segments at the end of the route, the router gets confused when processing a request which doesn't have any segments for the wildcard, and calls a handler for the wrong method.
Example:
https://go.dev/play/p/BTJeqbNMFbv
What did you see happen?
2009/11/10 23:00:00 Unexpected GET handler has been called
2009/11/10 23:00:00 Expected status code to be 200, but got 400
What did you expect to see?
I expected a handler for the POST route to be called and to see
"Test passed"
The text was updated successfully, but these errors were encountered: