Skip to content
Myr

HTTP/2 support for tunnelled proxy cases. (#2009)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Cap upload chunk sizes * Use '.read' for file streaming, where possible * Direct iteration should not apply chunk sizes * HTTP/2 support for proxies

authored by Tom Christie · committed by GitHub · parent 9d54375 · Browse files · 1 file+30 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+30 added−13 removed

  • other:+30 added−13 removed

1 file+30 added−13 removed

modified:httpx/_transports/default.py+30 added-13 removed
136 unmodified lines
137 local_address=local_address,138 retries=retries,139 )140 else:141 try:142 self._pool = httpcore.HTTPProxy(143 proxy_url=httpcore.URL(144 scheme=proxy.url.raw_scheme,145 host=proxy.url.raw_host,146 port=proxy.url.port,147 target=proxy.url.raw_path,148 ),149 proxy_headers=proxy.headers.raw,150 ssl_context=ssl_context,151 max_connections=limits.max_connections,152 max_keepalive_connections=limits.max_keepalive_connections,153 keepalive_expiry=limits.keepalive_expiry,154 http1=http1,155 http2=http2,156 )157 except TypeError: # pragma: nocover141 self._pool = httpcore.HTTPProxy(142 proxy_url=httpcore.URL(143 scheme=proxy.url.raw_scheme,144 host=proxy.url.raw_host,145 port=proxy.url.port,146 target=proxy.url.raw_path,147 ),148 proxy_headers=proxy.headers.raw,149 ssl_context=ssl_context,150 max_connections=limits.max_connections,151 max_keepalive_connections=limits.max_keepalive_connections,152 keepalive_expiry=limits.keepalive_expiry,153 )158 self._pool = httpcore.HTTPProxy(159 proxy_url=httpcore.URL(160 scheme=proxy.url.raw_scheme,161 host=proxy.url.raw_host,162 port=proxy.url.port,163 target=proxy.url.raw_path,164 ),165 proxy_headers=proxy.headers.raw,166 ssl_context=ssl_context,167 max_connections=limits.max_connections,168 max_keepalive_connections=limits.max_keepalive_connections,169 keepalive_expiry=limits.keepalive_expiry,170 )171172 def __enter__(self: T) -> T: # Use generics for subclass support.173 self._pool.__enter__()174 return self
146 unmodified lines