From e11ff5bacb3988242152f22cb635a5752bf59949 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Mon, 18 Aug 2014 19:48:01 +0200 Subject: [PATCH] response_writes uses 200 as default status code. --- response_writer.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/response_writer.go b/response_writer.go index 3d9de82d..2da8e336 100644 --- a/response_writer.go +++ b/response_writer.go @@ -22,7 +22,7 @@ type ( func (w *responseWriter) reset(writer http.ResponseWriter) { w.ResponseWriter = writer - w.status = 0 + w.status = 200 w.written = false } @@ -43,12 +43,7 @@ func (w *responseWriter) WriteHeaderNow() { } func (w *responseWriter) Write(data []byte) (n int, err error) { - if !w.written { - if w.status != 0 { - w.ResponseWriter.WriteHeader(w.status) - } - w.written = true - } + w.WriteHeaderNow() return w.ResponseWriter.Write(data) }