Skip to content

Commit b345f6f

Browse files
committed
Revert "fix: remove root path prefix when root_path is set on app"
This reverts commit 98d6488.
1 parent 92bd06f commit b345f6f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stac_fastapi/pgstac/models/links.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ 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 root_path := self.request.scope.get("root_path"):
68+
if (
69+
root_path := self.request.scope.get("root_path")
70+
) and not self.request.app.root_path:
6971
# self.request.app.root_path is set by FastAPI when running with FastAPI(root_path="...")
7072
# If self.request.app.root_path is not set but self.request.scope.get("root_path") is set,
7173
# then the root path is set by uvicorn

0 commit comments

Comments
 (0)