File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -200,9 +200,13 @@ def get_normalized_http_method(self):
200
200
def get_normalized_http_url (self ):
201
201
"""Parses the URL and rebuilds it to be scheme://host/path."""
202
202
parts = urlparse .urlparse (self .http_url )
203
- # scheme, netloc, path
204
- url_string = '%s://%s%s' % (parts [0 ], parts [1 ], parts [2 ])
205
- return url_string
203
+ scheme , netloc , path = parts [:3 ]
204
+ # Exclude default port numbers.
205
+ if scheme == 'http' :
206
+ netloc = netloc .rstrip (':80' )
207
+ elif scheme == 'https' :
208
+ netloc = netloc .rstrip (':443' )
209
+ return '%s://%s%s' % (scheme , netloc , path )
206
210
207
211
def sign_request (self , signature_method , consumer , token ):
208
212
"""Set the signature parameter to the result of build_signature."""
You can’t perform that action at this time.
0 commit comments