# HG changeset patch # User RhodeCode Admin # Date 2024-02-27 08:52:29 # Node ID cc68847eb2b4f54ff442c0d5f88e5daf7905e5f4 # Parent ad20d5fbac20a1a8c9440f3c7f0e670a7c9b3046 fix(service-api): rely on urljoin for constructing the call url diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -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")