Repository navigation
fix(uri): don't glue * onto the authority in Display - #884
Open
patrick-immometrica wants to merge 1 commit into
Open
patrick-immometrica wants to merge 1 commit into
patrick-immometrica wants to merge 1 commit into
Conversation
A Uri with scheme, authority and path `*` (allowed since hyperium#843 for HTTP/2 OPTIONS requests) was formatted as `https://example.com*`, which parses back with an authority of `example.com*`. hyper writes the request target with Display when talking to a proxy, so this also went out on the wire. Per RFC 9112 section 3.2.4 the absolute-form of `OPTIONS *` has an empty path, so leave the `*` out when there is an authority.
patrick-immometrica
marked this pull request as ready for review
November 5, 2026 11:08
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #843, an asterisk-form path can be combined with a scheme and authority, which h2 needs for
OPTIONS *.Displaythen writes the path straight after the authority:example.com*is a different authority. hyper's h1 client formats the request target withDisplay, so anOPTIONS *sent through an HTTP proxy in absolute form ends up with the wrong host on the wire.RFC 9112 3.2.4 says the absolute form of an asterisk-form request has an empty path (
OPTIONS http://example.com HTTP/1.1), so this skips writing*when there is an authority.path()still returns"*", and onlyDisplaychanges.I extended the existing
build_star_for_http2test. It fails on master:Note that the output no longer round-trips to an equal
Uri, since it reparses with path/. I think that's fine because the old output didn't round-trip either, and it parsed to the wrong host.