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 <codeberg@crapstone.dev>
Co-authored-by: reckter <reckter@noreply.codeberg.org>
Co-committed-by: reckter <reckter@noreply.codeberg.org>
This commit is contained in:
reckter 2025-06-25 22:52:01 +02:00 committed by crapStone
parent 5477ba2c46
commit 1cfd582755

View file

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