Skip to content

Commit

Permalink
fix: allow requests to /healthz without authentication (#1896)
Browse files Browse the repository at this point in the history
* fix: allow requests to /healthz without authentication

* allow unauthed requests to /status
  • Loading branch information
wendtek authored Nov 15, 2021
1 parent 24001aa commit f5b6ab0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ type RequestLogger struct {
func (l *RequestLogger) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
l.logger.Debug("%s %s – from %s", r.Method, r.URL.RequestURI(), r.RemoteAddr)
allowed := false
if r.URL.Path == "/events" || !l.WebAuthentication {
if !l.WebAuthentication ||
r.URL.Path == "/events" ||
r.URL.Path == "/healthz" ||
r.URL.Path == "/status" {
allowed = true
} else {
user, pass, ok := r.BasicAuth()
Expand Down

0 comments on commit f5b6ab0

Please sign in to comment.