From feb4e3b73b9920037863e5c2e97e2dc8d02ddcd5 Mon Sep 17 00:00:00 2001 From: Francesco Faraone Date: Mon, 13 Apr 2026 15:40:05 +0200 Subject: [PATCH] MPT-20236 query string was not added to the upstream url in presence of raw_path in asgi scope --- mrok/proxy/app.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mrok/proxy/app.py b/mrok/proxy/app.py index 97aec50..8a54b8c 100644 --- a/mrok/proxy/app.py +++ b/mrok/proxy/app.py @@ -172,9 +172,11 @@ def _merge_x_forwarded(self, headers: list[tuple[bytes, bytes]], scope: Scope) - headers[idx_proto] = (k, b"https") def _format_path(self, scope: Scope) -> str: - raw_path = scope.get("raw_path") - if raw_path: - return raw_path.decode() + path = scope.get("raw_path") + if path: + return path.decode() + else: + path = scope.get("path", "/") q = scope.get("query_string", b"") path = scope.get("path", "/") path_qs = path