Skip to content

Commit

Permalink
Use better Tornado handler to test fragment encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Nov 3, 2019
1 parent e975581 commit af15fe6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions dummyserver/handlers.py
Expand Up @@ -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!"
Expand Down
4 changes: 2 additions & 2 deletions test/with_dummyserver/test_connectionpool.py
Expand Up @@ -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:
Expand Down

0 comments on commit af15fe6

Please sign in to comment.