From 13fe0ca417dea0abb1b2bcce0285df6ec4038638 Mon Sep 17 00:00:00 2001 From: mahmut-the-guy <158579334+mahmut-the-guy@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:17:17 +0000 Subject: [PATCH] [client] Use `urljoin` to create API URL (#549) --- pycti/api/opencti_api_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pycti/api/opencti_api_client.py b/pycti/api/opencti_api_client.py index 26562475..84afc184 100644 --- a/pycti/api/opencti_api_client.py +++ b/pycti/api/opencti_api_client.py @@ -4,6 +4,7 @@ import io import json from typing import Union +from urllib.parse import urljoin import magic import requests @@ -129,7 +130,7 @@ def __init__( # Define API self.api_token = token - self.api_url = url + "/graphql" + self.api_url = urljoin(url, "/graphql") self.request_headers = { "User-Agent": "pycti/" + __version__, "Authorization": "Bearer " + token,