From 6e421ca20ec6eec52fa5940cc6859a37d7e7ceea Mon Sep 17 00:00:00 2001 From: Martin Mauch Date: Sat, 14 Dec 2024 09:58:41 +0100 Subject: [PATCH] Fix passing URL parameters when proxying (#1168) --- server/http_server.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/http_server.ts b/server/http_server.ts index a8ec78de..b2e0325d 100644 --- a/server/http_server.ts +++ b/server/http_server.ts @@ -695,7 +695,11 @@ export class HttpServer { if (this.spaceServer.readOnly) { return c.text("Read only mode, no federation proxy allowed", 405); } - let url = req.param("uri")!.slice(1); + + // Get the full URL including query parameters + const originalUrl = new URL(req.url); + let url = req.param("uri")!.slice(1) + originalUrl.search; + if (!req.header("X-Proxy-Request")) { // Direct browser request, not explicity fetch proxy request if (!looksLikePathWithExtension(url)) {