Skip to content

Commit

Permalink
Remove double slash
Browse files Browse the repository at this point in the history
Merging domain url and path url create double slash
which causes on localhost error 404 (Page not found).

Signed-off-by: Martin Sakin <marty@inuits.eu>
  • Loading branch information
matesaki committed May 5, 2022
1 parent 226cb9d commit f151817
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/vsc/utils/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ def hash_pass(self, password, username=None):
return 'Basic ' + encoded_credentials

def get_connection(self, method, url, body, headers):
if not self.url.endswith('/') and not url.startswith('/'):
sep = '/'
else:
url = url.lstrip('/')
if self.url.endswith('/'):
sep = ''
else:
sep = '/'
if body:
body = body.encode()
request = Request(self.url + sep + url, data=body)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
]

PACKAGE = {
'version': '3.4.5',
'version': '3.4.6',
'author': [sdw, jt, ag, kh],
'maintainer': [sdw, jt, ag, kh],
# as long as 1.0.0 is not out, vsc-base should still provide vsc.fancylogger
Expand Down

0 comments on commit f151817

Please sign in to comment.