diff options
author | Thomas Voss <mail@thomasvoss.com> | 2021-10-14 13:48:21 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2021-10-14 13:48:21 +0200 |
commit | fc0b71e67c9165978edab7cadda066a129bef78f (patch) | |
tree | 62452c9066d149aff63d220fe30fdd5ae973cb7a /mpaste.go | |
parent | 113120aa32fb6eac38d396fee1ee9fc60006d8ac (diff) |
[Syntax] Set content type to text/plain on 404
This keeps the appearance to the user consistent between URIs with file
extensions and URIs without them.
Diffstat (limited to 'mpaste.go')
-rw-r--r-- | mpaste.go | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -138,6 +138,7 @@ func syntax_highlighting(w http.ResponseWriter, r *http.Request) { data, err := ioutil.ReadFile(file_prefix + remove_ext(r.URL.Path[1:])) if err != nil { + w.Header().Set("Content-Type", "text/plain") WRITE_HEADER(http.StatusNotFound, "404 page not found") } |