-
Notifications
You must be signed in to change notification settings - Fork 4.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
allow_absolute_url causes misleading logs #8078
Comments
I think this may be a bug. I wouldn't expect "http://foo.com" to be a valid path. I think that'd imply we could have a url http://http://foo.com which I'm pretty sure isn't actually valid. I suspect what's happening is that http_parser (which handles absolute urls) is treating it as a url and we don't do path validation because we trust http parser, so I think I should just go ahead and fix this. @PiotrSikora for sanity checking |
Actually @snowp can you talk more to this problem? |
However, it should be split into I didn't look at the code, but from what @snowp is saying, it seems that's happening with |
Right, everything is passed through, and then immediately rejected by the HCM early on in decodeHeaders, as far as I can tell TEST_P(IntegrationTest, BadPath) Snow: is it possible you read the 404 as your matchers not matching rather than the URL being rejected as absolute? |
We sere seeing the |
gotcha. we could flat out reject it in the codec instead, which AFIK would mean you had no logs data as the stream won't have gotten headers. |
Is there any reason that we don't allow absolute-form by default? |
Orthogonal from how to make this behavior less confusing when we disallow: I'm failing to find where it was added but as I recall it was a high-ish risk PR (we didn't fully trust the url splitting utility) and we didn't yet have runtime overrides, so we made it a config option and defaulted to the old, safe, behavior. There was at least one bug with url parsing (I think it was that query parameters were dropped accidentally?) so it wasn't a terrible call. Today I would have been inclined to protect it rather than make it configurable. Annoyingly I don't think we can remove the option now that it's there but given it's a BoolValue I don't think it'd be unreasonable to switch the default where it's not configured and add a release note about the switch so folks who want to disallow can explicitly configure it off. Given this is totally legit HTTP/1 I think allowing it by default is the right thing to do. @mattklein123 WDYT? If you agree I'm happy to take that on. |
Sure makes sense to me to default to on at this point. |
I'm going to re-title. |
As discussed on #8078 absolute URLs are part of the HTTP/1 spec and the code has been used for some time now - turning it up by default. Risk Level: Medium (changes to L7 for many users) Testing: updated tests for new defaults Docs Changes: no Release Notes: yes Signed-off-by: Alyssa Wilk <[email protected]>
should evaluate |
As discussed on envoyproxy#8078 absolute URLs are part of the HTTP/1 spec and the code has been used for some time now - turning it up by default. Risk Level: Medium (changes to L7 for many users) Testing: updated tests for new defaults Docs Changes: no Release Notes: yes Signed-off-by: Alyssa Wilk <[email protected]>
Is this still a v3 API renaming ask or should we remove the label? |
I think it's a code fix not an API fix. label updated. |
As discussed on envoyproxy#8078 absolute URLs are part of the HTTP/1 spec and the code has been used for some time now - turning it up by default. Risk Level: Medium (changes to L7 for many users) Testing: updated tests for new defaults Docs Changes: no Release Notes: yes Signed-off-by: Alyssa Wilk <[email protected]>
As discussed on envoyproxy#8078 absolute URLs are part of the HTTP/1 spec and the code has been used for some time now - turning it up by default. Risk Level: Medium (changes to L7 for many users) Testing: updated tests for new defaults Docs Changes: no Release Notes: yes Signed-off-by: Alyssa Wilk <[email protected]>
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions. |
The
allow_aboslute_url
option on the http1 codec options on the HCM imply that leaving at the default of false will mean that absolute URLs are not allowed. Instead, what happens is that the url is passed unchanged as the:path
header to the HCM, which results in the full URI being used for route matching. As a result, the common idiom of usingprefix: /
as "match any" doesn't work because it doesn't match the scheme-prefixed URL.I'm not sure if this warrants any behavioral changes, but at the very least the docs should be clearer about what the implication of this option is. Maybe even renaming it to
handle_absolute_url
with V3?Relevant code: https://github.com/envoyproxy/envoy/blob/master/source/common/http/http1/codec_impl.cc#L544-L572
The text was updated successfully, but these errors were encountered: