Skip to content

Commit 0583624

Browse files
committed
Fixing trailing slash bug.
Should detect if user uses a trailing slash in the host argument and handle it gracefully.
1 parent 2ec0ba5 commit 0583624

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gitlab/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ def __init__(self, host, token="", version=5):
1515
if token != "":
1616
self.token = token
1717
self.headers = {"PRIVATE-TOKEN": self.token}
18-
self.host = host
18+
if host[-1] == '/':
19+
self.host = host[:-1]
20+
else:
21+
self.host = host
1922
self.projects_url = self.host + "/api/v3/projects"
2023
self.users_url = self.host + "/api/v3/users"
2124
self.keys_url = self.host + "/api/v3/user/keys"

0 commit comments

Comments
 (0)