aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2021-10-14 13:48:21 +0200
committerThomas Voss <mail@thomasvoss.com> 2021-10-14 13:48:21 +0200
commitfc0b71e67c9165978edab7cadda066a129bef78f (patch)
tree62452c9066d149aff63d220fe30fdd5ae973cb7a
parent113120aa32fb6eac38d396fee1ee9fc60006d8ac (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.
-rw-r--r--mpaste.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/mpaste.go b/mpaste.go
index ade4b8e..f105c2b 100644
--- a/mpaste.go
+++ b/mpaste.go
@@ -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")
}