Skip to content

Commit f099998

Browse files
authored
fix: ensure slash separator when joining URL paths (the base and endpoint URLs) (#4)
1 parent c08c68a commit f099998

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/crowdstrike_aidr/_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ def _prepare_url(self, url: str) -> URL:
190190
merge_url = URL(url)
191191
if merge_url.is_relative_url:
192192
base_url = self.base_url
193-
merge_raw_path = base_url.raw_path + merge_url.raw_path.lstrip(b"/")
193+
# Ensure exactly one slash separator between base and relative paths
194+
merge_raw_path = base_url.raw_path.rstrip(b"/") + b"/" + merge_url.raw_path.lstrip(b"/")
194195
return base_url.copy_with(raw_path=merge_raw_path)
195196

196197
return merge_url

0 commit comments

Comments
 (0)