aboutsummaryrefslogtreecommitdiffhomepage
path: root/mpaste.go
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2022-08-24 12:41:34 +0200
committerThomas Voss <mail@thomasvoss.com> 2022-08-24 12:41:34 +0200
commit5cfde572dd74f6596b0303eb31f8fdcec13fff52 (patch)
treefda08eeb1f923a2d0ff0394dd2843e4a0e212654 /mpaste.go
parente94d20ddebd1610f7c981e848f3e6415dcc36acf (diff)
Set charset to UTF-8
Diffstat (limited to 'mpaste.go')
-rw-r--r--mpaste.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/mpaste.go b/mpaste.go
index 16a1cef..c306878 100644
--- a/mpaste.go
+++ b/mpaste.go
@@ -142,7 +142,7 @@ func syntaxHighlighting(w http.ResponseWriter, r *http.Request) {
data, err := ioutil.ReadFile(filePrefix + removeExt(r.URL.Path[1:]))
if err != nil {
- w.Header().Set("Content-Type", "text/plain")
+ w.Header().Set("Content-Type", "text/plain; charset=utf-8")
writeHeader(w, http.StatusNotFound, "")
return
}
@@ -175,10 +175,10 @@ func endpoint(w http.ResponseWriter, r *http.Request) {
writeHeader(w, http.StatusNotFound, "")
return
case urlSyntax:
- w.Header().Set("Content-Type", "text/html")
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
syntaxHighlighting(w, r)
case urlValid:
- w.Header().Set("Content-Type", "text/plain")
+ w.Header().Set("Content-Type", "text/plain; charset=utf-8")
http.ServeFile(w, r, filePrefix+r.URL.Path[1:])
}
case http.MethodPost: