From fc0b71e67c9165978edab7cadda066a129bef78f Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 14 Oct 2021 13:48:21 +0200 Subject: [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. --- mpaste.go | 1 + 1 file changed, 1 insertion(+) (limited to 'mpaste.go') 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") } -- cgit v1.2.3