Skip to content

Commit 1986681

Browse files
committed
Remove code with misleading comments which does not achieve anything.
1 parent c868993 commit 1986681

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

api/utilities.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,8 @@ async def verify_parameter_names(parameter_names: list) -> None:
9191

9292

9393
def create_url_from_request(request):
94-
# The server root_path contains the path added by a reverse proxy
95-
base_path = request.scope.get("root_path")
96-
97-
# The host will (should) be correctly set from X-Forwarded-Host and X-Forwarded-Scheme
98-
# headers by any proxy in front of it
99-
host = request.headers["host"]
100-
scheme = request.url.scheme
101-
102-
return f"{scheme}://{host}{base_path}/collections"
94+
# IMPORTANT: We rely on proxy to block attempts to modify the URL (e.g. blocking "Host" header)
95+
return request.base_url
10396

10497

10598
def split_and_strip(cs_string: str) -> list[str]:

0 commit comments

Comments
 (0)