This repository was archived by the owner on Dec 19, 2025. It is now read-only.
Don't copy URI path & query to gateway request#46
Merged
DanGould merged 1 commit intopayjoin:mainfrom Feb 21, 2025
Merged
Conversation
When requests to the relay include a path & query, previously this would be copied to the request sent to the gateway. This behavior did not match the specified behavior in RFC 9458, where the relay and gateway resource are related by a fixed 1:1 mapping, whereas copying the path is a family of 1:1 mappings between relay resources and gateway resources. Less pedantic behavior could arguably simply ignore any extraneous path or query elements in the request URI, but based on the logic that any deployment relying on the existing behavior would be incompatible with the existing directory implementation, this more conservative path was chosen. This was only tested manually by temporarily modifying the ohttp_req test helper to ensure it fails (for both the request matching and the explicit treatment of req.uri().path_and_query()), in order to avoid modifying it with additional long lived complexity to allow overriding the path. The rationale is that in the near term protocol opt-in by directories will give meaning to path components of directory requests, and the modified behavior fails closed.
Merged
DanGould
approved these changes
Feb 6, 2025
Collaborator
There was a problem hiding this comment.
This appears to be correct expression of 1:1 Relay:Gateway Resource mapping.
The target resource information is encoded in each OHTTP Encapsulated request, not in the OHTTP request's path and query information.
(to be explicit: because the info is encoded in the request, all of the clients I know of are NOT going to be affected by this change even though it's technically breaking)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When requests to the relay include a path & query, previously this would be copied to the request sent to the gateway.
This behavior did not match the specified behavior in RFC 9458, where the relay and gateway resource are related by a fixed 1:1 mapping, whereas copying the path is a family of 1:1 mappings between relay resources and gateway resources.
Less pedantic behavior could arguably simply ignore any extraneous path or query elements in the request URI, but based on the logic that any deployment relying on the existing behavior would be incompatible with the existing directory implementation, this more conservative path was chosen.
This was only tested manually by temporarily modifying the ohttp_req test helper to ensure it fails (for both the request matching and the explicit treatment of req.uri().path_and_query()), in order to avoid modifying it with additional long lived complexity to allow overriding the path. The rationale is that in the near term protocol opt-in by directories will give meaning to path components of directory requests, and the modified behavior fails closed.