Fixes bug when status code is negative

This commit is contained in:
Manu Mtz-Almeida 2014-08-24 04:35:11 +02:00
parent 45fcd18064
commit b3f322c5fc
1 changed files with 1 additions and 1 deletions

View File

@ -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!")