-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
undocumented behaviour: HeadersRegexp wraps regexp in wildcard by default #124
Comments
I find this kind of behaviour/regex flavour quite disturbing especially because it's not documented. For example using |
@themihai If you can submit a PR documenting this it'd be hugely appreciated. I don't think we can (safely) change this behaviour given applications depending on it in the wild. |
@elithrar The problem is that it's not just undocumented behaviour, it's actually preventing you from supplying your own raw regex! |
@bluehallu I get that: but changing it would impact other applications out there. I'm not defending code I wrote (I didn't write it), I'm just making sure we don't make breaking changes where we can avoid that. |
What about an optional flag to change this behaviour? |
I'm open to that, if you have a proposal?
|
I'm afraid I only used Go once in my life, spotted this weird behaviour in one of the main libraries and reported it, but that's where my Mux knowledge ends. I don't think I'm in a position to make recommendations about how the Api for this library should be designed in any more detail than I already have. An optional boolean parameter "strict" comes to mind though :) |
I think a method [0]
[1] https://godoc.org/github.com/gorilla/mux#Router.StrictSlash |
@themihai That would be great. |
I'd like to add two examples to the documentation for The example file would contain two runnable examples:
|
@mtso go for it! |
This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days. |
Not sure if this is intended, but using this regexp
abc
, actually means you're using.*abc.*
. I don't think this is appropriate since it doesn't let me specify I want certain order on the Accept header, for instance.The text was updated successfully, but these errors were encountered: