Log invalid APIKey on API failures. (#4762)
Useful to understand which key is used.
This commit is contained in:
+1
-1
@@ -89,7 +89,7 @@ func (m *APIKeyAuthMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request,
|
|||||||
|
|
||||||
secret := m.provider.GetSecret(v.APIKey())
|
secret := m.provider.GetSecret(v.APIKey())
|
||||||
if secret == "" {
|
if secret == "" {
|
||||||
HandleError(w, r, http.StatusUnauthorized, ErrInvalidAPIKey)
|
HandleError(w, r, http.StatusUnauthorized, ErrInvalidAPIKey, "apiKey", v.APIKey())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user