mirror of
https://github.com/project-zot/zot.git
synced 2024-12-30 22:34:13 -05:00
commit
24361364a7
1 changed files with 7 additions and 2 deletions
|
@ -72,8 +72,13 @@ func Logger(log zerolog.Logger) mux.MiddlewareFunc {
|
|||
}
|
||||
clientIP := r.RemoteAddr
|
||||
method := r.Method
|
||||
headers := r.Header
|
||||
delete(headers, "Authorization") // strip from logs
|
||||
headers := map[string][]string{}
|
||||
for key, value := range r.Header {
|
||||
if key == "Authorization" { // anonymize from logs
|
||||
value = []string{"******"}
|
||||
}
|
||||
headers[key] = value
|
||||
}
|
||||
statusCode := sw.status
|
||||
bodySize := sw.length
|
||||
if raw != "" {
|
||||
|
|
Loading…
Reference in a new issue