summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQuentin Pradet <quentin.pradet@gmail.com>2019-10-31 15:13:02 +0400
committerSeth Michael Larson <sethmichaellarson@gmail.com>2019-11-21 22:55:19 -0600
commitc21a206acb0fdea82fb1be8cfc36189330c8ddd7 (patch)
treedc03e350799c7b1dda91bd5ad796775d607b6e0c /src
parent6ad48b61d74f322a0ae8457f8e3798b542775c96 (diff)
downloadurllib3-c21a206acb0fdea82fb1be8cfc36189330c8ddd7.tar.gz
Assume that _encode_target urls start with slash
Indeed, the only _encode_target only calls it if the url starts with a slash.
Diffstat (limited to 'src')
-rw-r--r--src/urllib3/util/url.py3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/urllib3/util/url.py b/src/urllib3/util/url.py
index f7568e9d..b01499ea 100644
--- a/src/urllib3/util/url.py
+++ b/src/urllib3/util/url.py
@@ -322,9 +322,6 @@ def _idna_encode(name):
def _encode_target(target):
"""Percent-encodes a request target so that there are no invalid characters"""
- if not target.startswith("/"):
- return target
-
path, query = TARGET_RE.match(target).groups()
target = _encode_invalid_chars(path, PATH_CHARS)
query = _encode_invalid_chars(query, QUERY_CHARS)