Skip to content

Commit 3e0e257

Browse files
fix: normalize base path and endpoint strings to prevent redundant or missing slashes in URL construction (#41)
1 parent 79c0a5a commit 3e0e257

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plane/api/base_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def _delete(self, endpoint: str, data: Mapping[str, Any] | None = None) -> None:
6868

6969
# Helpers
7070
def _build_url(self, endpoint: str) -> str:
71-
endpoint = endpoint.lstrip("/")
72-
base = f"{self.config.base_path}{self.base_path}/"
71+
endpoint = endpoint.strip("/")
72+
base = f"{self.config.base_path.rstrip('/')}{self.base_path}/"
7373
return f"{base}{endpoint}/" if endpoint else base
7474

7575
def _headers(self) -> dict[str, str]:

0 commit comments

Comments
 (0)