add remote address field on incoming request

This commit is contained in:
Adrien PONSIN 2025-04-15 19:37:23 +02:00
parent 2e900e88b0
commit 22ab7e250b
No known key found for this signature in database
GPG Key ID: 7B4D4A32C05C475E
2 changed files with 5 additions and 3 deletions

View File

@ -62,11 +62,13 @@ func buildVersion() string {
info, ok := debug.ReadBuildInfo()
if ok {
if info.Main.Version != "" {
return info.Main.Version + "-" + info.Main.Sum
version = info.Main.Version
commit = info.Main.Sum
}
}
if version == "" && commit == "" {
return "dev" + "-" + noCommit{}.String()
version = "dev"
commit = noCommit{}.String()
}
return version + "-" + commit
}

View File

@ -148,7 +148,7 @@ func Serve(group *errgroup.Group) *cli.Command {
}
func (ph *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Debug().Str("http_method", r.Method).Str("path", r.URL.Path).Msg("incoming request")
log.Debug().Str("remote_addr", r.RemoteAddr).Str("http_method", r.Method).Str("path", r.URL.Path).Msg("incoming request")
mr, ok := containerMethodRegex["*"]
if ok {
if err := checkMethodPath(w, r, mr); err != nil {