Repository navigation
fix(client): preserve URL components when appending endpoint paths - #753
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 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.
When a proxy
base_urlcontains a query string or fragment, URL construction appends the endpoint to the raw URL rather than its path. For example, listing organizations againsthttps://proxy.example/prefix?route=a%2Fbsends a request to/prefixand moves/organizationsinto the query. SSO/AuthKit authorization URLs have the same problem. Per-requestbase_urloverrides are affected too.Join the endpoint onto the parsed path, preserve the existing query and fragment, and append encoded operation parameters to the query. Normalize a trailing slash on the path rather than appending it after a query or fragment. Existing no-query/no-fragment behavior is covered by controls.
This changes only the hand-maintained
@oagen-ignore-filebase client and a similarly marked test file. Generated resources, schemas, authentication logic, and version/release files are untouched.Thirty public-client regression/control cases cover sync/async organization requests, constructor and per-request base URLs, and SSO/AuthKit authorization URLs, using an httpx2.MockTransport for HTTP requests. Eighteen fail before the fix; twelve controls pass. All 2,994 repository tests pass after the change. Repository-wide Ruff lint/format and Pyright pass (zero errors/warnings). Wheel and source distribution builds pass independently with a fresh cache; the initial combined uv build failed while extracting an archive. No live WorkOS request or account was used. Developed with AI assistance and verified locally.