Chore: sanitize values before being logged from request headers (#49245)

* Chore: sanitize values being logged directly from request headers
This commit is contained in:
Ezequiel Victorero
2022-05-23 14:18:33 -03:00
committed by GitHub
parent 51bc1bad1b
commit dfab100dc7
5 changed files with 187 additions and 1 deletions

View File

@@ -24,6 +24,8 @@ import (
"context"
"net/http"
"strings"
"github.com/grafana/grafana/pkg/infra/log"
)
const _VERSION = "1.3.4.0805"
@@ -156,6 +158,7 @@ func (m *Macaron) createContext(rw http.ResponseWriter, req *http.Request) *Cont
index: 0,
Router: m.Router,
Resp: NewResponseWriter(req.Method, rw),
logger: log.New("macaron.context"),
}
req = req.WithContext(context.WithValue(req.Context(), macaronContextKey{}, c))
c.Map(c)