Support HTTP/2 prior-knowledge, using `httpx.Client(http1=False, http2=True)`. (#1624)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* Pass flag http1 to httpcore. * Update httpcore version, reorder parameter list
authored by bli74 · committed by GitHub · parent 69409bb · Browse files · 3 files·+28 added−3 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: ebertli <bert.lindemann@ericsson.com>
- Co-authored-by: Tom Christie <tom@tomchristie.com>
Diff stats
3 files+28 added−3 removed
- other:+28 added−3 removed
Provenance
- Commit
9b17671- Tree
47407bb- Author
bli74 <bert.lindemann@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
69409bb
3 files changed+28 added−3 removed
modified:httpx/_transports/default.py+4 added
114 unmodified lines115 def __init__(116 self,117 verify: VerifyTypes = True,118 cert: CertTypes = None,119+ http1: bool = True,120 http2: bool = False,121 limits: Limits = DEFAULT_LIMITS,122 trust_env: bool = True,123 proxy: Proxy = None,9 unmodified lines133 ssl_context=ssl_context,134 max_connections=limits.max_connections,135 max_keepalive_connections=limits.max_keepalive_connections,136 keepalive_expiry=limits.keepalive_expiry,137+ http1=http1,138 http2=http2,139 uds=uds,140 local_address=local_address,141 retries=retries,70 unmodified lines212 def __init__(213 self,214 verify: VerifyTypes = True,215 cert: CertTypes = None,216+ http1: bool = True,217 http2: bool = False,218 limits: Limits = DEFAULT_LIMITS,219 trust_env: bool = True,220 proxy: Proxy = None,9 unmodified lines230 ssl_context=ssl_context,231 max_connections=limits.max_connections,232 max_keepalive_connections=limits.max_keepalive_connections,233 keepalive_expiry=limits.keepalive_expiry,234+ http1=http1,235 http2=http2,236 uds=uds,237 local_address=local_address,238 retries=retries,58 unmodified linesmodified:httpx/_client.py+23 added-2 removed
604 unmodified lines605 headers: HeaderTypes = None,606 cookies: CookieTypes = None,607 verify: VerifyTypes = True,608 cert: CertTypes = None,609+ http1: bool = True,610 http2: bool = False,611 proxies: ProxiesTypes = None,612 mounts: typing.Mapping[str, BaseTransport] = None,613 timeout: TimeoutTypes = DEFAULT_TIMEOUT_CONFIG,31 unmodified lines645 646 self._transport = self._init_transport(647 verify=verify,648 cert=cert,649+ http1=http1,650 http2=http2,651 limits=limits,652 transport=transport,653 app=app,5 unmodified lines659 else self._init_proxy_transport(660 proxy,661 verify=verify,662 cert=cert,663+ http1=http1,664 http2=http2,665 limits=limits,666 trust_env=trust_env,667 )9 unmodified lines677 def _init_transport(678 self,679 verify: VerifyTypes = True,680 cert: CertTypes = None,681+ http1: bool = True,682 http2: bool = False,683 limits: Limits = DEFAULT_LIMITS,684 transport: BaseTransport = None,685 app: typing.Callable = None,5 unmodified lines691 if app is not None:692 return WSGITransport(app=app)693 694 return HTTPTransport(691- verify=verify, cert=cert, http2=http2, limits=limits, trust_env=trust_env695+ verify=verify,696+ cert=cert,697+ http1=http1,698+ http2=http2,699+ limits=limits,700+ trust_env=trust_env,701 )702 703 def _init_proxy_transport(704 self,705 proxy: Proxy,706 verify: VerifyTypes = True,707 cert: CertTypes = None,708+ http1: bool = True,709 http2: bool = False,710 limits: Limits = DEFAULT_LIMITS,711 trust_env: bool = True,712 ) -> BaseTransport:713 return HTTPTransport(714 verify=verify,715 cert=cert,716+ http1=http1,717 http2=http2,718 limits=limits,719 trust_env=trust_env,720 proxy=proxy,583 unmodified lines1304 headers: HeaderTypes = None,1305 cookies: CookieTypes = None,1306 verify: VerifyTypes = True,1307 cert: CertTypes = None,1308+ http1: bool = True,1309 http2: bool = False,1310 proxies: ProxiesTypes = None,1311 mounts: typing.Mapping[str, AsyncBaseTransport] = None,1312 timeout: TimeoutTypes = DEFAULT_TIMEOUT_CONFIG,31 unmodified lines1344 1345 self._transport = self._init_transport(1346 verify=verify,1347 cert=cert,1348+ http1=http1,1349 http2=http2,1350 limits=limits,1351 transport=transport,1352 app=app,6 unmodified lines1359 else self._init_proxy_transport(1360 proxy,1361 verify=verify,1362 cert=cert,1363+ http1=http1,1364 http2=http2,1365 limits=limits,1366 trust_env=trust_env,1367 )8 unmodified lines1376 def _init_transport(1377 self,1378 verify: VerifyTypes = True,1379 cert: CertTypes = None,1380+ http1: bool = True,1381 http2: bool = False,1382 limits: Limits = DEFAULT_LIMITS,1383 transport: AsyncBaseTransport = None,1384 app: typing.Callable = None,5 unmodified lines1390 if app is not None:1391 return ASGITransport(app=app)1392 1393 return AsyncHTTPTransport(1379- verify=verify, cert=cert, http2=http2, limits=limits, trust_env=trust_env1394+ verify=verify,1395+ cert=cert,1396+ http1=http1,1397+ http2=http2,1398+ limits=limits,1399+ trust_env=trust_env,1400 )1401 1402 def _init_proxy_transport(1403 self,1404 proxy: Proxy,1405 verify: VerifyTypes = True,1406 cert: CertTypes = None,1407+ http1: bool = True,1408 http2: bool = False,1409 limits: Limits = DEFAULT_LIMITS,1410 trust_env: bool = True,1411 ) -> AsyncBaseTransport:559 unmodified linesmodified:setup.py+1 added-1 removed
57 unmodified lines58 install_requires=[59 "certifi",60 "sniffio",61 "rfc3986[idna2008]>=1.3,<2",62- "httpcore>=0.13.0,<0.14.0",62+ "httpcore>=0.13.3,<0.14.0",63 "async_generator; python_version < '3.7'"64 ],65 extras_require={66 "http2": "h2==3.*",19 unmodified lines