mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-19 16:30:07 +08:00
fix: wrong conditional judgment in removeExtraHTTPHostPort
Some checks failed
Trigger CMFA Update / trigger-CMFA-update (push) Failing after 1s
Some checks failed
Trigger CMFA Update / trigger-CMFA-update (push) Failing after 1s
https://github.com/MetaCubeX/mihomo/issues/1939
This commit is contained in:
parent
f61534602b
commit
025ff19fab
@ -47,7 +47,7 @@ func removeExtraHTTPHostPort(req *http.Request) {
|
|||||||
host = req.URL.Host
|
host = req.URL.Host
|
||||||
}
|
}
|
||||||
|
|
||||||
if pHost, port, err := net.SplitHostPort(host); err == nil && (port == "80" || port == "443") {
|
if pHost, port, err := net.SplitHostPort(host); err == nil && port == "80" {
|
||||||
host = pHost
|
host = pHost
|
||||||
if ip, err := netip.ParseAddr(pHost); err == nil && ip.Is6() {
|
if ip, err := netip.ParseAddr(pHost); err == nil && ip.Is6() {
|
||||||
// RFC 2617 Sec 3.2.2, for IPv6 literal
|
// RFC 2617 Sec 3.2.2, for IPv6 literal
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user