Fix escaped error message

- This specific message will [already be generated](974229681f/html/error.go (L44)) when
`http.StatusMisdirectedRequest` is set as status with [an empty message](974229681f/html/error.go (L25-L28)).
- Resolves https://codeberg.org/Codeberg/pages-server/issues/228
This commit is contained in:
Gusted 2023-07-16 23:30:44 +02:00
parent 974229681f
commit c52e373daa
No known key found for this signature in database
GPG key ID: FD821B732837125F

View file

@ -49,7 +49,7 @@ func handleCustomDomain(log zerolog.Logger, ctx *context.Context, giteaClient *g
}, canonicalLink); works {
canonicalDomain, valid := targetOpt.CheckCanonicalDomain(giteaClient, trimmedHost, mainDomainSuffix, canonicalDomainCache)
if !valid {
html.ReturnErrorPage(ctx, "domain not specified in <code>.domains</code> file", http.StatusMisdirectedRequest)
html.ReturnErrorPage(ctx, "", http.StatusMisdirectedRequest)
return
} else if canonicalDomain != trimmedHost {
// only redirect if the target is also a codeberg page!