aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSubhaditya Nath <[email protected]>2024-01-10 17:54:47 +0530
committerGitHub <[email protected]>2024-01-10 12:24:47 +0000
commitc2d889f85e6941b892f36c5873d3f9a4995191f8 (patch)
tree2a63866723110f06cf2bbda3baf41ab801b34903
parentcb86319bd50322d4ac9e730b2fc5639daa24b82a (diff)
downloadcaddy-c2d889f85e6941b892f36c5873d3f9a4995191f8.tar.gz
caddy-c2d889f85e6941b892f36c5873d3f9a4995191f8.zip
httpcaddyfile: Fix redir <to> html (#6001)
-rw-r--r--caddyconfig/httpcaddyfile/builtins.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/caddyconfig/httpcaddyfile/builtins.go b/caddyconfig/httpcaddyfile/builtins.go
index f345a676f..701beff7d 100644
--- a/caddyconfig/httpcaddyfile/builtins.go
+++ b/caddyconfig/httpcaddyfile/builtins.go
@@ -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