Skip to content

Commit 9c050e0

Browse files
committed
fix request url construction
make API requests also work if no subdomain is given
1 parent c66dd85 commit 9c050e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hackpad_api/hackpad.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ def do_api_request(self, path, method, post_data={}, body='', content_type='text
122122
method = method.upper()
123123
hackpad = {}
124124
try:
125-
api_method = urljoin('https://%s.hackpad.com/api/1.0/' % self.sub_domain, path)
125+
if self.sub_domain:
126+
api_method = urljoin('https://%s.hackpad.com/api/1.0/' % self.sub_domain, path)
127+
else:
128+
api_method = urljoin('https://hackpad.com/api/1.0/', path)
129+
126130
params = {
127131
'oauth_version': "1.0",
128132
'oauth_nonce': oauth2.generate_nonce(),

0 commit comments

Comments
 (0)