Skip to content

Commit

Permalink
OAuth1: Allow IPv6 addresses being parsed by signature
Browse files Browse the repository at this point in the history
This PR addresses issue with incorrectly parsing IPv6 address,
described here: oauthlib#817
  • Loading branch information
dasm committed May 19, 2022
1 parent b14ad85 commit 49294a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oauthlib/oauth1/rfc5849/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def base_string_uri(uri: str, host: str = None) -> str:
if ':' in netloc:
# Contains a colon ":", so try to parse as "host:port"

hostname, port_str = netloc.split(':', 1)
hostname, port_str = netloc.rsplit(':', 1)

if len(hostname) == 0:
raise ValueError('missing host') # error: netloc was ":port" or ":"
Expand Down

0 comments on commit 49294a6

Please sign in to comment.