Skip to content

Commit db9f270

Browse files
authored
fix: remove root path prefix when root_path is set on app
1 parent d33b0f3 commit db9f270

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

stac_fastapi/pgstac/models/links.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ def url(self):
6565
# We need to remove the root path prefix from the path before
6666
# joining the base_url and path to get the full url to avoid
6767
# having root_path twice in the url
68-
if (
69-
root_path := self.request.scope.get("root_path")
70-
) and not self.request.app.root_path:
68+
if (root_path := self.request.scope.get("root_path")):
7169
# self.request.app.root_path is set by FastAPI when running with FastAPI(root_path="...")
7270
# If self.request.app.root_path is not set but self.request.scope.get("root_path") is set,
7371
# then the root path is set by uvicorn

0 commit comments

Comments
 (0)