Skip to content

Commit ea10ecb

Browse files
author
Sergio Moya
committed
HealthCheck middleware only handles non-nil errors
1 parent 17206e6 commit ea10ecb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

router/middleware.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ func HealthCheck(route string, f APIHandler) Middleware {
8787
w.WriteHeader(http.StatusOK)
8888
return
8989
}
90-
HandleError(f(w, r), w, r)
90+
if err := f(w, r); err != nil {
91+
HandleError(f(w, r), w, r)
92+
}
9193
return
9294
}
9395
next.ServeHTTP(w, r)

0 commit comments

Comments
 (0)