summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDariusz Smigiel <dsmigiel@redhat.com>2022-05-19 09:41:59 -0700
committerDariusz Smigiel <dsmigiel@redhat.com>2022-05-19 09:41:59 -0700
commit49294a6a7cb6e9ece1c1814d629e2d9e497180fa (patch)
treefec3fd6c2cb023d871646a1ab1d341792fdfebb6
parentb14ad85921db2406ecaf5927a8be08a7566c236e (diff)
downloadoauthlib-49294a6a7cb6e9ece1c1814d629e2d9e497180fa.tar.gz
OAuth1: Allow IPv6 addresses being parsed by signature
This PR addresses issue with incorrectly parsing IPv6 address, described here: https://github.com/oauthlib/oauthlib/issues/817
-rw-r--r--oauthlib/oauth1/rfc5849/signature.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/oauthlib/oauth1/rfc5849/signature.py b/oauthlib/oauth1/rfc5849/signature.py
index a370ccd..424393b 100644
--- a/oauthlib/oauth1/rfc5849/signature.py
+++ b/oauthlib/oauth1/rfc5849/signature.py
@@ -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 ":"