Repository navigation
fix: preserve base URL query components in requests - #213
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
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.
Problem
A custom base URL such as
https://gateway.example/gateway?workspace=demoproduces/gateway/?workspace=demo/messages/message-idwhen retrieving a message. The endpoint becomes part of the query, so gateway deployments request the wrong resource. The trailing-slash helper also appends/to the query value because HTTPXraw_pathincludes the query string.Change
Separate raw path and query components when normalizing and joining URLs. Preserve percent-encoded paths, base and endpoint queries, and fragments. Absolute endpoint URLs remain independent of the client's base URL.
Add 16 sync/async public-client transport regressions, including normal message retrieval and query/absolute URL controls. The first 12 cases run on the original code: 8 fail, 4 pass. No hosted API or credentials are used.
Validation
Environment notes: the development lock has mutually incompatible filelock/virtualenv pins. Python 3.12 used an environment-only filelock override; Python 3.9 used virtualenv20.34.0. Repository dependency files are unchanged. Locked Mypy on Python3.12 also reports an existing typing.TypeAliasType incompatibility in untouched
_typing.py; the repository's Python3.9 target passes Mypy.The core module is generator-managed; CONTRIBUTING.md permits persisted manual changes. Maintainers may wish to propagate this fix to the generator as well.