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
Is your feature request related to a problem? Please describe.
If a client is (mis)configured to make requests with lowercase method names, it is impossible to use gorilla/mux to match.
Describe the solution that you would like.
Case insensitive matches on methods.
Describe alternatives you have considered.
One way is to stop strings.ToUpper-ing defined methods, but that would break compatibility. Documenting the current limitation if the behavior is not changed would also go far.
It is incorrect to ignore case when comparing HTTP method names because HTTP method names are case sensitive. The methods "GET" and "get" are different.
The problem is that Methods calls strings.ToUpper on the method name. The method name should be used as is.
The maintainers are in a bit of a pickle here. Removing the call to strings.ToUpper will break compatibility. Case insensitive comparison will incorrectly match method names.
OP can work around this mess by wrapping the mux with a handler that uppercases the Request.Method before invoking the mux.
Is there an existing feature request for this?
Is your feature request related to a problem? Please describe.
If a client is (mis)configured to make requests with lowercase method names, it is impossible to use gorilla/mux to match.
Describe the solution that you would like.
Case insensitive matches on methods.
Describe alternatives you have considered.
One way is to stop
strings.ToUpper
-ing defined methods, but that would break compatibility. Documenting the current limitation if the behavior is not changed would also go far.Anything else?
A test case that demonstrates the condition:
Also, thanks!
The text was updated successfully, but these errors were encountered: