fix redirect with wrong target port

This commit is contained in:
ginuerzh 2022-04-01 21:41:19 +08:00
parent 00b3d0bc70
commit 066e6b90e6

View File

@ -210,7 +210,11 @@ func (h *redirectHandler) handleHTTPS(ctx context.Context, rw io.ReadWriter, rad
if host == "" { if host == "" {
host = dstAddr.String() host = dstAddr.String()
} else { } else {
host = net.JoinHostPort(host, "443") _, port, _ := net.SplitHostPort(dstAddr.String())
if port == "" {
port = "443"
}
host = net.JoinHostPort(host, port)
} }
log = log.WithFields(map[string]any{ log = log.WithFields(map[string]any{