mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-02 00:05:27 +00:00
Fix #2399
This commit is contained in:
parent
68c32d8627
commit
267b1af835
@ -78,7 +78,7 @@ def encode(s: Sequence[Tuple[str, str]], similar_to: str=None) -> str:
|
||||
|
||||
if remove_trailing_equal:
|
||||
encoded = encoded.replace("=&", "&")
|
||||
if encoded[-1] == '=':
|
||||
if encoded and encoded[-1] == '=':
|
||||
encoded = encoded[:-1]
|
||||
|
||||
return encoded
|
||||
|
@ -108,6 +108,7 @@ def test_empty_key_trailing_equal_sign():
|
||||
def test_encode():
|
||||
assert url.encode([('foo', 'bar')])
|
||||
assert url.encode([('foo', surrogates)])
|
||||
assert not url.encode([], similar_to="justatext")
|
||||
|
||||
|
||||
def test_decode():
|
||||
|
Loading…
Reference in New Issue
Block a user