Skip to content

Commit 1710ba4

Browse files
gadomskiGeosynopsis
andcommitted
fixup: prevent double-slashes from self_href
Co-authored-by: Abhishek Manandhar <[email protected]>
1 parent 5a586a9 commit 1710ba4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pystac_client/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,8 @@ def _get_collections_href(self, id: Optional[str] = None) -> str:
515515
)
516516
else:
517517
collections_href = data_link.href
518-
elif self_href.endswith("/"):
519-
collections_href = f"{self_href}collections"
520518
else:
521-
collections_href = f"{self_href}/collections"
519+
collections_href = f"{self_href.rstrip('/')}/collections"
522520

523521
if not pystac.utils.is_absolute_href(collections_href):
524522
collections_href = self._make_absolute_href(collections_href)

0 commit comments

Comments
 (0)