Skip to content

fix(client): thread all transport kwargs into the sync transport - #254

Closed
benesch wants to merge 1 commit into
nextfrom
roko/thread-transport-kwargs
Closed

fix(client): thread all transport kwargs into the sync transport#254
benesch wants to merge 1 commit into
nextfrom
roko/thread-transport-kwargs

Conversation

@benesch

@benesch benesch commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Supplying a custom transport makes httpx ignore every transport-construction kwarg, not just limits. As a result the default sync client silently dropped options like verify and http2 when a caller set them. This threads them through so they take effect again, matching httpx's own transport construction.

Follow-up to #252, which fixed the same class of bug for limits only.

Supplying a custom transport makes httpx ignore every transport
construction kwarg, not just limits, so options like verify and http2
were silently dropped by the default sync client. Reproduce httpx's own
transport construction so they take effect again.
@benesch

benesch commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #255 (branch renamed to benesch/thread-all-transport-kwargs).

@benesch benesch closed this Aug 4, 2026
@benesch
benesch deleted the roko/thread-transport-kwargs branch August 4, 2026 12:05

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5deec9d. Configure here.

http2=kwargs.get("http2", False),
limits=kwargs["limits"],
),
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Async transport omits client kwargs

Medium Severity

verify, cert, trust_env, http1, and http2 are now threaded into the sync HttpxTransport, but _DefaultAsyncHttpxClient still builds AiohttpTransport/TCPConnector with only limits. Because a custom transport makes httpx ignore those client kwargs, async callers still silently drop TLS and protocol settings. This violates the rule that httpx client settings must be threaded through to every transport layer.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by learned rule: Ensure httpx client settings are threaded to all transports

Reviewed by Cursor Bugbot for commit 5deec9d. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant