mirror of
https://github.com/foomo/keel.git
synced 2025-10-16 12:35:34 +00:00
feat: check x-forwarded-host
This commit is contained in:
parent
bbca691de3
commit
62dd070d26
@ -45,8 +45,12 @@ func WithHTTPRequest(l *zap.Logger, r *http.Request) *zap.Logger {
|
||||
FHTTPTarget(r.RequestURI),
|
||||
}
|
||||
|
||||
if r.Host != "" {
|
||||
if value := r.Header.Get("X-Forwarded-Host"); value != "" {
|
||||
fields = append(fields, FHTTPHost(value))
|
||||
} else if !r.URL.IsAbs() {
|
||||
fields = append(fields, FHTTPHost(r.Host))
|
||||
} else {
|
||||
fields = append(fields, FHTTPHost(r.URL.Host))
|
||||
}
|
||||
if id := r.Header.Get("X-Request-ID"); id != "" {
|
||||
fields = append(fields, FHTTPRequestID(id))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user