Skip to content

Commit

Permalink
Assume that _encode_target urls start with slash
Browse files Browse the repository at this point in the history
Indeed, the only _encode_target only calls it if the url starts with a
slash.
  • Loading branch information
pquentin committed Nov 8, 2019
1 parent a642f45 commit 18f00ce
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/urllib3/util/url.py
Expand Up @@ -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)
Expand Down

0 comments on commit 18f00ce

Please sign in to comment.