Chore: merge branch 'ogn-dev' into with-tun

This commit is contained in:
yaling888 2022-05-16 01:41:02 +08:00
commit e92bea8401

View File

@ -13,7 +13,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, serverConn *N.BufferedConn, request *http.Request, in chan<- C.ConnContext) (resp *http.Response) { func HandleUpgrade(localConn net.Conn, serverConn *N.BufferedConn, request *http.Request, in chan<- C.ConnContext) (resp *http.Response) {