diff --git a/server/server.go b/server/server.go index 7d77d7d..49d5f85 100644 --- a/server/server.go +++ b/server/server.go @@ -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()) }