mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 06:06:38 +01:00
Move token logs to trace
This commit is contained in:
parent
6a7e5a959b
commit
028f19ac47
1 changed files with 2 additions and 2 deletions
|
|
@ -26,8 +26,8 @@ func New(token string) *API {
|
||||||
func (api *API) RequireToken(fn http.HandlerFunc) http.HandlerFunc {
|
func (api *API) RequireToken(fn http.HandlerFunc) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
if r.Header.Get("Authorization") != fmt.Sprintf("Bearer %s", api.Token) {
|
if r.Header.Get("Authorization") != fmt.Sprintf("Bearer %s", api.Token) {
|
||||||
log.Errorf("Invalid token \"%s\"", r.Header.Get("Authorization"))
|
log.Tracef("Invalid token \"%s\"", r.Header.Get("Authorization"))
|
||||||
log.Debugf("Expected token to be \"%s\"", api.Token)
|
log.Tracef("Expected token to be \"%s\"", api.Token)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Debug("Valid token found.")
|
log.Debug("Valid token found.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue