fix host parsing

This commit is contained in:
ginuerzh
2024-07-10 22:57:49 +08:00
parent f2e32080e4
commit 4a4c64cc66
11 changed files with 76 additions and 56 deletions

View File

@ -132,7 +132,7 @@ func (h *http2Handler) roundTrip(ctx context.Context, w http.ResponseWriter, req
addr := req.Host
if _, port, _ := net.SplitHostPort(addr); port == "" {
addr = net.JoinHostPort(addr, "80")
addr = net.JoinHostPort(strings.Trim(addr, "[]"), "80")
}
fields := map[string]any{