diff options
Diffstat (limited to '404.go')
-rw-r--r-- | 404.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1,5 +1,10 @@ package main +import ( + "net/http" + "fmt" +) + const predefined404 = ` <!DOCTYPE html> <html> @@ -56,3 +61,10 @@ const predefined404 = ` </body> </html> ` + +func serve404(w http.ResponseWriter) { + w.Header().Set("Content-Type", "text/plain; charset=utf-8") + w.Header().Set("X-Content-Type-Options", "nosniff") + w.WriteHeader(http.StatusNotFound) + fmt.Fprintln(w, predefined404) +} |