Fix http logger to report status OK if never set

pull/2195/head
Cory LaNou 2015-04-08 09:38:17 -06:00
parent aedb8ab300
commit ea94f342f1
1 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,10 @@ func (l *responseLogger) WriteHeader(s int) {
}
func (l *responseLogger) Status() int {
if l.status == 0 {
// This can happen if we never actually write data, but only set response headers.
l.status = http.StatusOK
}
return l.status
}