File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import logging
4- import os
54import time
65from abc import ABCMeta , abstractmethod
76from functools import wraps
1615 Tuple ,
1716 Union ,
1817)
18+ from urllib .parse import urljoin
1919
2020from httpx import URL , Headers , Response , codes
2121
@@ -381,7 +381,7 @@ async def _api_request(
381381 if self .parameters :
382382 parameters = {** self .parameters , ** parameters }
383383 return await self ._client .request (
384- url = os . path . join (self .engine_url , path or "" ),
384+ url = urljoin (self .engine_url . rstrip ( "/" ) + "/" , path or "" ),
385385 method = "POST" ,
386386 params = parameters ,
387387 content = query ,
@@ -451,7 +451,7 @@ async def _api_request(
451451 if self .parameters :
452452 parameters = {** self .parameters , ** parameters }
453453 return await self ._client .request (
454- url = os . path . join (self .engine_url , path or "" ),
454+ url = urljoin (self .engine_url . rstrip ( "/" ) + "/" , path or "" ),
455455 method = "POST" ,
456456 params = {
457457 ** (parameters or dict ()),
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import logging
4- import os
54import time
65from abc import ABCMeta , abstractmethod
76from typing import (
1413 Tuple ,
1514 Union ,
1615)
16+ from urllib .parse import urljoin
1717
1818from httpx import URL , Headers , Response , codes
1919
@@ -331,7 +331,7 @@ def _api_request(
331331 if self .parameters :
332332 parameters = {** self .parameters , ** parameters }
333333 return self ._client .request (
334- url = os . path . join (self .engine_url , path or "" ),
334+ url = urljoin (self .engine_url . rstrip ( "/" ) + "/" , path or "" ),
335335 method = "POST" ,
336336 params = parameters ,
337337 content = query ,
@@ -398,7 +398,7 @@ def _api_request(
398398 if self .parameters :
399399 parameters = {** self .parameters , ** parameters }
400400 return self ._client .request (
401- url = os . path . join (self .engine_url , path or "" ),
401+ url = urljoin (self .engine_url . rstrip ( "/" ) + "/" , path or "" ),
402402 method = "POST" ,
403403 params = {
404404 ** (parameters or dict ()),
You can’t perform that action at this time.
0 commit comments