diff --git a/dummyserver/handlers.py b/dummyserver/handlers.py index 8089432af0..b751d83fcc 100644 --- a/dummyserver/handlers.py +++ b/dummyserver/handlers.py @@ -229,6 +229,10 @@ def echo(self, request): return Response(request.body) + def echo_uri(self, request): + "Echo back the requested URI" + return Response(request.uri) + def encodingrequest(self, request): "Check for UA accepting gzip/deflate encoding" data = b"hello, world!" diff --git a/test/with_dummyserver/test_connectionpool.py b/test/with_dummyserver/test_connectionpool.py index afc30cb939..5ca8e402f6 100644 --- a/test/with_dummyserver/test_connectionpool.py +++ b/test/with_dummyserver/test_connectionpool.py @@ -717,8 +717,8 @@ def test_percent_encode_invalid_target_chars(self): def test_percent_encode_fragment(self): with HTTPConnectionPool(self.host, self.port) as pool: - r = pool.request("GET", "/echo_params?q=1#fragment") - assert r.data == b"[('q', '1#fragment')]" + r = pool.request("GET", "/echo_uri?q=1#fragment") + assert r.data == b"/echo_uri?q=1#fragment" def test_source_address(self): for addr, is_ipv6 in VALID_SOURCE_ADDRESSES: