add remote address field on incoming request
This commit is contained in:
parent
2e900e88b0
commit
22ab7e250b
@ -62,11 +62,13 @@ func buildVersion() string {
|
|||||||
info, ok := debug.ReadBuildInfo()
|
info, ok := debug.ReadBuildInfo()
|
||||||
if ok {
|
if ok {
|
||||||
if info.Main.Version != "" {
|
if info.Main.Version != "" {
|
||||||
return info.Main.Version + "-" + info.Main.Sum
|
version = info.Main.Version
|
||||||
|
commit = info.Main.Sum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if version == "" && commit == "" {
|
if version == "" && commit == "" {
|
||||||
return "dev" + "-" + noCommit{}.String()
|
version = "dev"
|
||||||
|
commit = noCommit{}.String()
|
||||||
}
|
}
|
||||||
return version + "-" + commit
|
return version + "-" + commit
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ func Serve(group *errgroup.Group) *cli.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ph *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
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["*"]
|
mr, ok := containerMethodRegex["*"]
|
||||||
if ok {
|
if ok {
|
||||||
if err := checkMethodPath(w, r, mr); err != nil {
|
if err := checkMethodPath(w, r, mr); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user