From 1cfd5827551ad6f5c749b100f12e6a9d36a269a6 Mon Sep 17 00:00:00 2001 From: reckter Date: Wed, 25 Jun 2025 22:52:01 +0200 Subject: [PATCH] Keep query parameter on redirect to canonicalDomain in try upstream handler (#499) My go knowledge is limited so I cant test this really. Also not sure if including the raw query always is the right idea. might fix https://codeberg.org/Codeberg/pages-server/issues/478 Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/499 Reviewed-by: crapStone Co-authored-by: reckter Co-committed-by: reckter --- server/handler/try.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/handler/try.go b/server/handler/try.go index e5fc49b..f084b28 100644 --- a/server/handler/try.go +++ b/server/handler/try.go @@ -33,7 +33,7 @@ func tryUpstream(log zerolog.Logger, ctx *context.Context, giteaClient *gitea.Cl } } - redirect_to := "https://" + canonicalDomain + canonicalPath + redirect_to := "https://" + canonicalDomain + canonicalPath + "?" + ctx.Req.URL.RawQuery log.Debug().Str("to", redirect_to).Msg("redirecting")