Skip to content

Commit 5fad97e

Browse files
committed
fix: protocol reuse in reverse proxy and http client
1 parent 548a2c6 commit 5fad97e

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
### Fixed
1919

20-
*
20+
* Protocol re-usage in proxy reverse
2121

2222
## [1.53.12] - 2026-04-27
2323

src/netius/clients/http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,7 @@ def method(
12631263
request=False,
12641264
close=True,
12651265
asynchronous=True,
1266+
protocol=None,
12661267
timeout=None,
12671268
ssl_verify=False,
12681269
use_file=False,
@@ -1285,7 +1286,7 @@ def method(
12851286
# for connection re-usage (avoids long establish connection times)
12861287
# notice that the event loop is also re-used accordingly
12871288
key = cls.protocol.key_g(url)
1288-
protocol = self.available.pop(key, None)
1289+
protocol = protocol or self.available.pop(key, None)
12891290
if protocol and (
12901291
not protocol.is_open()
12911292
or not protocol.transport()

src/netius/extra/proxy_r.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ def on_headers(self, connection, parser):
457457
encodings=None,
458458
safe=True,
459459
connection=proxy_c,
460+
protocol=proxy_c,
460461
)
461462

462463
# in case the connection returned by the HTTP client is not the same

0 commit comments

Comments
 (0)