mirror of https://github.com/Dreamacro/clash.git
Fix: http request keepAlive with right http header
This commit is contained in:
parent
0011c7acfe
commit
23bb01a4df
|
@ -25,12 +25,9 @@ func (t *Tunnel) handleHTTP(request *adapters.HTTPAdapter, outbound net.Conn) {
|
||||||
conn := newTrafficTrack(outbound, t.traffic)
|
conn := newTrafficTrack(outbound, t.traffic)
|
||||||
req := request.R
|
req := request.R
|
||||||
host := req.Host
|
host := req.Host
|
||||||
keepalive := true
|
|
||||||
|
|
||||||
for {
|
for {
|
||||||
if strings.ToLower(req.Header.Get("Connection")) == "close" {
|
keepAlive := strings.TrimSpace(strings.ToLower(req.Header.Get("Proxy-Connection"))) == "keep-alive"
|
||||||
keepalive = false
|
|
||||||
}
|
|
||||||
|
|
||||||
req.Header.Set("Connection", "close")
|
req.Header.Set("Connection", "close")
|
||||||
req.RequestURI = ""
|
req.RequestURI = ""
|
||||||
|
@ -58,7 +55,7 @@ func (t *Tunnel) handleHTTP(request *adapters.HTTPAdapter, outbound net.Conn) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if !keepalive {
|
if !keepAlive {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue