summaryrefslogtreecommitdiff
path: root/oauthlib/oauth1/rfc5849/signature.py
diff options
context:
space:
mode:
authorIb Lundgren <ib.lundgren@gmail.com>2013-09-12 11:43:27 +0100
committerIb Lundgren <ib.lundgren@gmail.com>2013-09-12 11:43:27 +0100
commitec2e33f982ea0a8a73ba8b6a27093acad9b60f78 (patch)
tree28a544640b37dd05ba0068247911f5afea2b066d /oauthlib/oauth1/rfc5849/signature.py
parent1640640d756b4cdf9ced2d3df0ad0015670616d9 (diff)
downloadoauthlib-ec2e33f982ea0a8a73ba8b6a27093acad9b60f78.tar.gz
Fix scheme check for python 2.6.
urlparse.urlparse is buggy in python 2.6 and gives the netloc value to scheme if no scheme is preset. Thus we check for both scheme and netloc.
Diffstat (limited to 'oauthlib/oauth1/rfc5849/signature.py')
-rw-r--r--oauthlib/oauth1/rfc5849/signature.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/oauthlib/oauth1/rfc5849/signature.py b/oauthlib/oauth1/rfc5849/signature.py
index 7225469..77849ab 100644
--- a/oauthlib/oauth1/rfc5849/signature.py
+++ b/oauthlib/oauth1/rfc5849/signature.py
@@ -133,8 +133,8 @@ def normalize_base_string_uri(uri, host=None):
#
# .. _`RFC3986`: http://tools.ietf.org/html/rfc3986
- if not scheme:
- raise ValueError('uri must include a scheme')
+ if not scheme or not netloc:
+ raise ValueError('uri must include a scheme and netloc')
# Per `RFC 2616 section 5.1.2`_:
#