Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 11, 2021. It is now read-only.

Commit af21fa8

Browse files
author
leah.culver
committed
Python: fix for making sure the default ports are at the end of the string before stripping them. Thanks Brad Choate.
git-svn-id: https://oauth.googlecode.com/svn/code/python@1044 f7ae4463-c52f-0410-a7dc-93bad6e629e8
1 parent 1ba3d8b commit af21fa8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎oauth/oauth.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ def get_normalized_http_url(self):
202202
parts = urlparse.urlparse(self.http_url)
203203
scheme, netloc, path = parts[:3]
204204
# Exclude default port numbers.
205-
if scheme == 'http':
206-
netloc = netloc.rstrip(':80')
207-
elif scheme == 'https':
208-
netloc = netloc.rstrip(':443')
205+
if scheme == 'http'andnetloc[-3:] ==':80':
206+
netloc = netloc[:-3]
207+
elif scheme == 'https'andnetloc[-4:] ==':443':
208+
netloc = netloc[:-4]
209209
return '%s://%s%s' % (scheme, netloc, path)
210210

211211
def sign_request(self, signature_method, consumer, token):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /