Catch invalid header
This commit is contained in:
parent
fb4a2010d6
commit
fe10226ab2
@ -71,6 +71,11 @@ func (srv *server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write(errRes.ErrorResponse())
|
||||
srv.logger.Logf(log.LevelError, "request failed: %s", errRes.String())
|
||||
}
|
||||
w.WriteHeader(res.HttpStatus())
|
||||
if res.HttpStatus() >= 100 {
|
||||
w.WriteHeader(res.HttpStatus())
|
||||
} else {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
srv.logger.Logf(log.LevelError, "received invalid status from service (%d)", res.HttpStatus())
|
||||
}
|
||||
w.Write(res.Response())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user