summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-03-14 18:09:04 -0400
committerDerrick Anderson <derrick@andersonwebstudio.com>2018-03-14 18:09:04 -0400
commitd1ed79a66c7930020b7fda046a11050f5890c84e (patch)
tree4e3643ae58ed10f680d4b04015f5c332ab2c7c38 /utils
parentddc6d49d804505fe8e96e14c7dd00d8964fd726b (diff)
downloadchat-d1ed79a66c7930020b7fda046a11050f5890c84e.tar.gz
chat-d1ed79a66c7930020b7fda046a11050f5890c84e.tar.bz2
chat-d1ed79a66c7930020b7fda046a11050f5890c84e.zip
Add content type to API error response (#8460)
Diffstat (limited to 'utils')
-rw-r--r--utils/api.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/utils/api.go b/utils/api.go
index 0f2640829..b5e490eb7 100644
--- a/utils/api.go
+++ b/utils/api.go
@@ -59,6 +59,7 @@ func RenderWebError(w http.ResponseWriter, r *http.Request, status int, params u
return
}
+ w.Header().Set("Content-Type", "text/html")
w.WriteHeader(status)
fmt.Fprintln(w, `<!DOCTYPE html><html><head></head>`)
fmt.Fprintln(w, `<body onload="window.location = '`+template.HTMLEscapeString(template.JSEscapeString(destination))+`'">`)