fix(client): thread all transport kwargs into the sync transport - #254
fix(client): thread all transport kwargs into the sync transport#254benesch wants to merge 1 commit into
Conversation
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.
|
Superseded by #255 (branch renamed to benesch/thread-all-transport-kwargs). |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ 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"], | ||
| ), | ||
| ) |
There was a problem hiding this comment.
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)
Triggered by learned rule: Ensure httpx client settings are threaded to all transports
Reviewed by Cursor Bugbot for commit 5deec9d. Configure here.


Supplying a custom transport makes httpx ignore every transport-construction kwarg, not just
limits. As a result the default sync client silently dropped options likeverifyandhttp2when 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
limitsonly.