mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 14:58:38 +00:00
Keep blank URL parameters
TODO: This should probably be configurable
This commit is contained in:
parent
53792a5a28
commit
6bcf29c0ed
@ -67,7 +67,7 @@ def urldecode(s):
|
||||
"""
|
||||
Takes a urlencoded string and returns a list of (key, value) tuples.
|
||||
"""
|
||||
return cgi.parse_qsl(s)
|
||||
return cgi.parse_qsl(s, keep_blank_values=True)
|
||||
|
||||
|
||||
def urlencode(s):
|
||||
|
@ -58,7 +58,9 @@ class TestContentView:
|
||||
d = utils.urlencode([("one", "two"), ("three", "four")])
|
||||
v = cv.ViewURLEncoded()
|
||||
assert v([], d, 100)
|
||||
assert not v([], "foo", 100)
|
||||
d = utils.urlencode([("adsfa", "")])
|
||||
v = cv.ViewURLEncoded()
|
||||
assert v([], d, 100)
|
||||
|
||||
def test_view_html(self):
|
||||
v = cv.ViewHTML()
|
||||
|
@ -807,7 +807,7 @@ class TestRequest:
|
||||
|
||||
r = flow.Request(None, (1, 1), "host", 22, "https", "GET", "/?adsfa", h, "content")
|
||||
q = r.get_query()
|
||||
assert not q
|
||||
assert q.lst == [("adsfa", "")]
|
||||
|
||||
r = flow.Request(None, (1, 1), "host", 22, "https", "GET", "/foo?x=y&a=b", h, "content")
|
||||
assert r.get_query()
|
||||
|
Loading…
Reference in New Issue
Block a user