##// END OF EJS Templates
fix(service-api): rely on urljoin for constructing the call url
super-admin -
r5319:cc68847e default
parent child Browse files
Show More
@@ -21,6 +21,7 b' Utilities library for RhodeCode'
21 """
21 """
22
22
23 import datetime
23 import datetime
24
24 import decorator
25 import decorator
25 import logging
26 import logging
26 import os
27 import os
@@ -31,6 +32,7 b' import socket'
31 import tempfile
32 import tempfile
32 import traceback
33 import traceback
33 import tarfile
34 import tarfile
35 import urllib.parse
34 import warnings
36 import warnings
35 from functools import wraps
37 from functools import wraps
36 from os.path import join as jn
38 from os.path import join as jn
@@ -849,7 +851,7 b' def call_service_api(ini_path, payload):'
849 'auth_token': config.get('app:main', 'app.service_api.token')
851 'auth_token': config.get('app:main', 'app.service_api.token')
850 })
852 })
851
853
852 response = CurlSession().post(f'{host}{api_url}', json.dumps(payload))
854 response = CurlSession().post(urllib.parse.urljoin(host, api_url), json.dumps(payload))
853
855
854 if response.status_code != 200:
856 if response.status_code != 200:
855 raise Exception("Service API responded with error")
857 raise Exception("Service API responded with error")
General Comments 0
You need to be logged in to leave comments. Login now