grim/goserve

Parents 1a13ea69c95f
Children
Gross fix, but this will set the content type when we're serving up the custom 404 page
  • +5 -0
    response.go
  • --- a/response.go Sat Jan 04 09:17:21 2020 -0600
    +++ b/response.go Sat Jan 04 14:27:20 2020 -0600
    @@ -52,6 +52,11 @@
    func (w *responseWriter) WriteHeader(code int) {
    if !w.wroteHeader {
    w.wroteHeader = true
    +
    + if code == http.StatusNotFound && w.notFoundFile != "" {
    + w.w.Header().Set("Content-Type", "text/html")
    + }
    +
    w.code = code
    }