httpcaddyfile: Fix redir <to> html (#6001)

This commit is contained in:
Subhaditya Nath 2024-01-10 17:54:47 +05:30 committed by GitHub
parent cb86319bd5
commit c2d889f85e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -711,6 +711,7 @@ func parseRedir(h Helper) (caddyhttp.MiddlewareHandler, error) {
`
safeTo := html.EscapeString(to)
body = fmt.Sprintf(metaRedir, safeTo, safeTo, safeTo, safeTo)
hdr = http.Header{"Content-Type": []string{"text/html; charset=utf-8"}}
code = "200" // don't redirect non-browser clients
default:
// Allow placeholders for the code