From b3f322c5fc19d68e297ae0a175770b232eae0bc1 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Sun, 24 Aug 2014 04:35:11 +0200 Subject: [PATCH] Fixes bug when status code is negative --- response_writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/response_writer.go b/response_writer.go index 2da8e336..91afe89b 100644 --- a/response_writer.go +++ b/response_writer.go @@ -27,7 +27,7 @@ func (w *responseWriter) reset(writer http.ResponseWriter) { } func (w *responseWriter) WriteHeader(code int) { - if code != 0 { + if code > 0 { w.status = code if w.written { log.Println("[GIN] WARNING. Headers were already written!")