Skip to content

Commit 05441cb

Browse files
committed
Merge branch 'master' of github.com:joestump/python-oauth2
2 parents 6205e68 + 928f9d7 commit 05441cb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

oauth2/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def __init__(self, method=HTTP_METHOD, url=None, parameters=None,
357357
def url(self, value):
358358
self.__dict__['url'] = value
359359
if value is not None:
360-
scheme, netloc, path, params, query, fragment = urlparse.urlparse(value)
360+
scheme, netloc, path, query, fragment = urlparse.urlsplit(value)
361361

362362
# Exclude default port numbers.
363363
if scheme == 'http' and netloc[-3:] == ':80':
@@ -368,7 +368,7 @@ def url(self, value):
368368
raise ValueError("Unsupported URL %s (%s)." % (value, scheme))
369369

370370
# Normalized URL excludes params, query, and fragment.
371-
self.normalized_url = urlparse.urlunparse((scheme, netloc, path, None, None, None))
371+
self.normalized_url = urlparse.urlunsplit((scheme, netloc, path, None, None))
372372
else:
373373
self.normalized_url = None
374374
self.__dict__['url'] = None

tests/test_oauth.py

+6
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,12 @@ def test_get_normalized_parameters_ignores_auth_signature(self):
716716
foo = params.copy()
717717
del foo["oauth_signature"]
718718
self.assertEqual(urllib.urlencode(sorted(foo.items())), res)
719+
720+
def test_signature_base_string_with_matrix_params(self):
721+
url = "http://social.yahooapis.com/v1/user/6677/connections;start=0;count=20"
722+
req = oauth.Request("GET", url, None)
723+
self.assertEquals(req.normalized_url, 'http://social.yahooapis.com/v1/user/6677/connections;start=0;count=20')
724+
self.assertEquals(req.url, 'http://social.yahooapis.com/v1/user/6677/connections;start=0;count=20')
719725

720726
def test_set_signature_method(self):
721727
consumer = oauth.Consumer('key', 'secret')

0 commit comments

Comments
 (0)