-
Notifications
You must be signed in to change notification settings - Fork 111
Add HTTP/2 support and protocol version logging #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
210f59b
00ff8bf
5779bf1
dcc3285
edba4bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,7 +174,11 @@ def _build_envelope(self, p_options, e_options): | |
| origin=url.hostname, | ||
| uuid=uuid, | ||
| auth_key=auth_key, | ||
| client_request=res.request | ||
| client_request=res.request, | ||
| http_version=( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, but there's nothing we can do here, and we need to ensure that our API is transport-resilient. I would keep setting a |
||
| f"HTTP/{res.raw.version // 10}.{res.raw.version % 10}" | ||
| if res.raw and res.raw.version else None | ||
| ) | ||
| ) | ||
|
|
||
| if not res.ok: | ||
|
|
@@ -268,7 +272,12 @@ def _invoke_request(self, p_options, e_options, base_origin): | |
|
|
||
| try: | ||
| res = self.session.request(**args) | ||
| logger.debug("GOT %s" % res.text) | ||
| http_ver = ( | ||
| f"HTTP/{res.raw.version // 10}.{res.raw.version % 10}" | ||
| if res.raw and res.raw.version else "unknown" | ||
| ) | ||
| logger.debug("[%s %s] %s" % (e_options.operation_type, http_ver, res.text)) | ||
|
|
||
| except requests.exceptions.ConnectionError as e: | ||
| raise PubNubException( | ||
| pn_error=PNERR_CONNECTION_ERROR, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ flake8>=7.1.2 | |
| pytest>=8.3.5 | ||
| pytest-asyncio>=1.0.0 | ||
| httpx>=0.28 | ||
| h2>=4.1 | ||
| h2>=4.3 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only development dependencies, but there is actual package dependencies which needs to be updated as well in |
||
| requests>=2.32.2 | ||
| aiohttp>=3.10.11 | ||
| cbor2>=5.6 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, that
aiohttpdopes't support HTTP/2 at all.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, but there's nothing we can do here, and we need to ensure that our API is transport-resilient. I would keep setting a
http_versionfield for consistency, even though it will always beHTTP/1.1. What's your take on that?