Fixes bug when status code is negative
This commit is contained in:
parent
45fcd18064
commit
b3f322c5fc
@ -27,7 +27,7 @@ func (w *responseWriter) reset(writer http.ResponseWriter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *responseWriter) WriteHeader(code int) {
|
func (w *responseWriter) WriteHeader(code int) {
|
||||||
if code != 0 {
|
if code > 0 {
|
||||||
w.status = code
|
w.status = code
|
||||||
if w.written {
|
if w.written {
|
||||||
log.Println("[GIN] WARNING. Headers were already written!")
|
log.Println("[GIN] WARNING. Headers were already written!")
|
||||||
|
Loading…
Reference in New Issue
Block a user