We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c868993 commit 1986681Copy full SHA for 1986681
api/utilities.py
@@ -91,15 +91,8 @@ async def verify_parameter_names(parameter_names: list) -> None:
91
92
93
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"
+ # IMPORTANT: We rely on proxy to block attempts to modify the URL (e.g. blocking "Host" header)
+ return request.base_url
103
104
105
def split_and_strip(cs_string: str) -> list[str]:
0 commit comments