mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-23 12:42:27 +08:00
fix: fix upgrade header detect (#2134)
This commit is contained in:
parent
c3f4e1ba2e
commit
d3503ff940
@ -15,7 +15,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func isUpgradeRequest(req *http.Request) bool {
|
func isUpgradeRequest(req *http.Request) bool {
|
||||||
return strings.EqualFold(req.Header.Get("Connection"), "Upgrade")
|
for _, header := range req.Header["Connection"] {
|
||||||
|
for _, elm := range strings.Split(header, ",") {
|
||||||
|
if strings.EqualFold(strings.TrimSpace(elm), "Upgrade") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleUpgrade(localConn net.Conn, source net.Addr, request *http.Request, in chan<- C.ConnContext) (resp *http.Response) {
|
func handleUpgrade(localConn net.Conn, source net.Addr, request *http.Request, in chan<- C.ConnContext) (resp *http.Response) {
|
||||||
|
Loading…
Reference in New Issue
Block a user