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
[bug] Host matching not work without scheme? #530
Comments
also to add: I found it only working as expected when you chain |
The examples in the docs may be a little confusing. If you say You should either:
... or use |
I've seen a few issues from people confused by this behavior, and I think it's just the nature of the builder pattern mux uses. It makes sense, it's just not very intuitive to people new to mux. It could help to add a sentence to the Matching Routes section of the README that says something along the lines of: "Matchers without attached handlers will still match routes, however they will 404, even taking priority over routes with handlers (if added first)." with maybe an example similar to @pierreneter 's. |
Agree. I think a new “How does mux Match Routes?” section in the README /
doc.go is warranted.
…On Fri, Nov 29, 2019 at 7:45 PM Franklin Harding ***@***.***> wrote:
I've seen a few issues from people confused by this behavior, and I think
it's just the nature of the builder pattern mux uses. It makes sense, it's
just not very intuitive to people new to mux. It could help to add a
sentence to the Matching Routes section of the README that says something
along the lines of: "Matchers without attached handlers will still match
routes, however they will 404, even taking priority over routes with
handlers (if added first)." with maybe an example similar to @pierreneter
<https://github.com/pierreneter> 's.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#530?email_source=notifications&email_token=AAAEQ4BW2FW6WW2DJW7JBYLQWHOTZA5CNFSM4JIR5PPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFPYVIA#issuecomment-559909536>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEQ4DXJUNWZWCP5QMH4R3QWHOTZANCNFSM4JIR5PPA>
.
|
I think #474 should resolve this. |
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. |
Describe the bug
About: Matching Routes - Host
The docs:
It will not work if
the host
is passed in without a scheme.Versions
Steps to Reproduce / Code Snippets
This not work:
This work:
Expected behavior
Work without scheme
The text was updated successfully, but these errors were encountered: