1
0
Fork 0

accesslog: multiple times the same header name.

This commit is contained in:
Ludovic Fernandez 2021-07-09 14:22:13 +02:00 committed by GitHub
parent 6d8512bda0
commit 5d3dc3348e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View file

@ -10,6 +10,7 @@ import (
"net/url"
"os"
"path/filepath"
"strings"
"sync"
"sync/atomic"
"time"
@ -344,7 +345,7 @@ func (h *Handler) redactHeaders(headers http.Header, fields logrus.Fields, prefi
for k := range headers {
v := h.config.Fields.KeepHeader(k)
if v == types.AccessLogKeep {
fields[prefix+k] = headers.Get(k)
fields[prefix+k] = strings.Join(headers.Values(k), ",")
} else if v == types.AccessLogRedact {
fields[prefix+k] = "REDACTED"
}