diff options
author | Thomas Voss <mail@thomasvoss.com> | 2022-08-24 12:41:34 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2022-08-24 12:41:34 +0200 |
commit | 5cfde572dd74f6596b0303eb31f8fdcec13fff52 (patch) | |
tree | fda08eeb1f923a2d0ff0394dd2843e4a0e212654 /mpaste.go | |
parent | e94d20ddebd1610f7c981e848f3e6415dcc36acf (diff) |
Set charset to UTF-8
Diffstat (limited to 'mpaste.go')
-rw-r--r-- | mpaste.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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: |