Skip to content

Commit

Permalink
Fix panic on serve logging and add message (#98)
Browse files Browse the repository at this point in the history
* Fix panic on serve logging and add message

* Also do the same on errors
  • Loading branch information
jaydhulia authored Oct 15, 2021
1 parent b7a0ff5 commit 43ee64d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions pkg/httpAuth/mtls/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func (wc *wrappedCertificate) autoRefresh() {
select {
case event, ok := <-watcher.Events:
if !ok {
logging.Log.Warn("problem with mTLS file watcher")
return
}
logging.Log.Debugf("event received: %v", event)
Expand All @@ -119,10 +118,9 @@ func (wc *wrappedCertificate) autoRefresh() {
}
case watcherError, ok := <-watcher.Errors:
if !ok {
logging.Log.Warn("problem with mTLS file watcher")
return
}
logging.Log.Error(watcherError)
logging.LogError(watcherError, "problem with mTLS file watcher")
}
}
}()
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func AWSHeaderMiddleware(next http.HandlerFunc) http.HandlerFunc {
"user-agent": ua,
"path": r.URL.Path,
"metadata_version": metadataVersion,
}).Info()
}).Info("Running AWS Header Middleware")
next.ServeHTTP(w, r)
}
}
Expand Down

0 comments on commit 43ee64d

Please sign in to comment.