parse real client IP

This commit is contained in:
ginuerzh
2025-07-15 19:59:10 +08:00
parent d9a2f44a78
commit afcf4a5252
24 changed files with 232 additions and 74 deletions
+4 -1
View File
@@ -49,9 +49,12 @@ type metadata struct {
func (h *httpHandler) parseMetadata(md mdata.Metadata) error {
h.md.readTimeout = mdutil.GetDuration(md, "readTimeout")
if h.md.readTimeout <= 0 {
if h.md.readTimeout == 0 {
h.md.readTimeout = 15 * time.Second
}
if h.md.readTimeout < 0 {
h.md.readTimeout = 0
}
if m := mdutil.GetStringMapString(md, "http.header", "header"); len(m) > 0 {
hd := http.Header{}