Fix passing URL parameters when proxying (#1168)

pull/1183/head
Martin Mauch 2024-12-14 09:58:41 +01:00 committed by GitHub
parent 2020e85a6f
commit 6e421ca20e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -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)) {