Fix handling of Github API paths and add tests
This commit is contained in:
parent
cf947962dc
commit
9558c0e937
3 changed files with 60 additions and 1 deletions
|
@ -108,7 +108,11 @@ class GithubOAuthConfig(OAuthConfig):
|
|||
return self.config.get('API_ENDPOINT', slash_join(self._endpoint(), '/api/v3/'))
|
||||
|
||||
def api_endpoint(self):
|
||||
return self._api_endpoint()[0:-1]
|
||||
endpoint = self._api_endpoint()
|
||||
if endpoint.endswith('/'):
|
||||
return endpoint[0:-1]
|
||||
|
||||
return endpoint
|
||||
|
||||
def user_endpoint(self):
|
||||
return slash_join(self._api_endpoint(), 'user')
|
||||
|
|
Reference in a new issue