fix(service-api): rely on urljoin for constructing the call url
This commit is contained in:
parent
fb6b7a3692
commit
5d6400eec0
1 changed files with 3 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ Utilities library for RhodeCode
|
|||
"""
|
||||
|
||||
import datetime
|
||||
|
||||
import decorator
|
||||
import logging
|
||||
import os
|
||||
|
|
@ -31,6 +32,7 @@ import socket
|
|||
import tempfile
|
||||
import traceback
|
||||
import tarfile
|
||||
import urllib.parse
|
||||
import warnings
|
||||
from functools import wraps
|
||||
from os.path import join as jn
|
||||
|
|
@ -849,7 +851,7 @@ def call_service_api(ini_path, payload):
|
|||
'auth_token': config.get('app:main', 'app.service_api.token')
|
||||
})
|
||||
|
||||
response = CurlSession().post(f'{host}{api_url}', json.dumps(payload))
|
||||
response = CurlSession().post(urllib.parse.urljoin(host, api_url), json.dumps(payload))
|
||||
|
||||
if response.status_code != 200:
|
||||
raise Exception("Service API responded with error")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue