Skip to content

Commit

Permalink
Merge pull request #152 from jwilk/urljoin
Browse files Browse the repository at this point in the history
Use urljoin() unconditionally
  • Loading branch information
koalalorenzo committed Aug 11, 2016
2 parents d4ce63b + e582b18 commit 5b280e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions digitalocean/Metadata.py
Expand Up @@ -25,8 +25,7 @@ def get_data(self, url, headers=dict(), params=dict(), render_json=True):
Customized version of get_data to directly get the data without
using the authentication method.
"""
if "https" not in url:
url = urljoin(self.end_point, url)
url = urljoin(self.end_point, url)

response = requests.get(url, headers=headers, params=params)

Expand Down
3 changes: 1 addition & 2 deletions digitalocean/baseapi.py
Expand Up @@ -59,8 +59,7 @@ def __perform_request(self, url, type=GET, params=None):
if not self.token:
raise TokenError("No token provided. Please use a valid token")

if "https" not in url:
url = urljoin(self.end_point, url)
url = urljoin(self.end_point, url)

# lookup table to find out the apropriate requests method,
# headers and payload type (json or query parameters)
Expand Down

0 comments on commit 5b280e2

Please sign in to comment.