Skip to content

Commit

Permalink
use proper urljoin
Browse files Browse the repository at this point in the history
  • Loading branch information
generall committed Jan 22, 2025
1 parent 0513a58 commit 4c90075
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qdrant_client/http/api_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from asyncio import get_event_loop
from functools import lru_cache
from typing import Any, Awaitable, Callable, Dict, Generic, Type, TypeVar, overload
from urllib.parse import urljoin

from httpx import AsyncClient, Client, Request, Response
from pydantic import ValidationError
Expand Down Expand Up @@ -81,7 +82,7 @@ def request( # noqa F811
) -> Any:
if path_params is None:
path_params = {}
url = (self.host or "") + url.format(**path_params)
url = urljoin((self.host or ""), url.format(**path_params))
if "params" in kwargs and "timeout" in kwargs["params"]:
kwargs["timeout"] = int(kwargs["params"]["timeout"])
request = self._client.build_request(method, url, **kwargs)
Expand Down Expand Up @@ -155,7 +156,7 @@ async def request( # noqa F811
) -> Any:
if path_params is None:
path_params = {}
url = (self.host or "") + url.format(**path_params)
url = urljoin((self.host or ""), url.format(**path_params))
request = self._async_client.build_request(method, url, **kwargs)
return await self.send(request, type_)

Expand Down

0 comments on commit 4c90075

Please sign in to comment.