mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Fix: fix upgrade header detect (#2134)
This commit is contained in:
parent
da7ffc0da9
commit
b384449717
|
@ -12,7 +12,15 @@ import (
|
|||
)
|
||||
|
||||
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(conn net.Conn, request *http.Request, in chan<- C.ConnContext) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user