1
0
Fork 0

refactor: minor changes.

This commit is contained in:
Fernandez Ludovic 2017-08-24 00:59:59 +02:00 committed by Traefiker
parent f1a257abf8
commit 8235cd3645
2 changed files with 4 additions and 2 deletions

View file

@ -80,7 +80,7 @@ func (r *responseRecorder) Flush() {
func (s *StatsRecorder) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
recorder := &responseRecorder{w, http.StatusOK}
next(recorder, r)
if recorder.statusCode >= 400 {
if recorder.statusCode >= http.StatusBadRequest {
s.mutex.Lock()
defer s.mutex.Unlock()
s.recentErrors = append([]*statsError{