From 195ee57ce3f9383b8f81fcb101469407e0e543e4 Mon Sep 17 00:00:00 2001 From: Abhinav Singh Date: Thu, 18 Nov 2021 17:50:47 +0530 Subject: [PATCH] `PROXY_AGENT_HEADER_VALUE` still needs the `v` :) --- proxy/common/constants.py | 2 +- tests/http/test_protocol_handler.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy/common/constants.py b/proxy/common/constants.py index e1134af7cb..4a34ba462e 100644 --- a/proxy/common/constants.py +++ b/proxy/common/constants.py @@ -47,7 +47,7 @@ def _env_threadless_compliant() -> bool: HTTP_1_1 = b'HTTP/1.1' PROXY_AGENT_HEADER_KEY = b'Proxy-agent' -PROXY_AGENT_HEADER_VALUE = b'proxy.py ' + \ +PROXY_AGENT_HEADER_VALUE = b'proxy.py v' + \ __version__.encode('utf-8', 'strict') PROXY_AGENT_HEADER = PROXY_AGENT_HEADER_KEY + \ COLON + WHITESPACE + PROXY_AGENT_HEADER_VALUE diff --git a/tests/http/test_protocol_handler.py b/tests/http/test_protocol_handler.py index 7ef30b7cc3..c37740a4f3 100644 --- a/tests/http/test_protocol_handler.py +++ b/tests/http/test_protocol_handler.py @@ -397,7 +397,8 @@ def assert_data_queued( b'Via: 1.1 proxy.py v%s' % bytes_(__version__), CRLF, ]) - server.queue.assert_called_once_with(pkt) + server.queue.assert_called_once() + self.assertEqual(server.queue.call_args_list[0][0][0].tobytes(), pkt) server.buffer_size.return_value = len(pkt) def assert_data_queued_to_server(self, server: mock.Mock) -> None: