MCPcopy Index your code
hub / github.com/csev/py4e / get_normalized_http_url

Method get_normalized_http_url

code/oauth.py:202–211  ·  view source on GitHub ↗

Parses the URL and rebuilds it to be scheme://host/path.

(self)

Source from the content-addressed store, hash-verified

200 return self.http_method.upper()
201
202 def get_normalized_http_url(self):
203 """Parses the URL and rebuilds it to be scheme://host/path."""
204 parts = urlparse.urlparse(self.http_url)
205 scheme, netloc, path = parts[:3]
206 # Exclude default port numbers.
207 if scheme == 'http' and netloc[-3:] == ':80':
208 netloc = netloc[:-3]
209 elif scheme == 'https' and netloc[-4:] == ':443':
210 netloc = netloc[:-4]
211 return '%s://%s%s' % (scheme, netloc, path)
212
213 def sign_request(self, signature_method, consumer, token):
214 """Set the signature parameter to the result of build_signature."""

Callers 2

to_urlMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected