mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-14 21:31:16 +08:00
Fix: HTTP proxy should copy body
This commit is contained in:
parent
65f4a35e7f
commit
52cfa94652
@ -36,6 +36,7 @@ func (t *Tunnel) handleHTTP(request *adapters.HTTPAdapter, outbound net.Conn) {
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
adapters.RemoveHopByHopHeaders(resp.Header)
|
||||
|
||||
if resp.StatusCode == http.StatusContinue {
|
||||
@ -59,6 +60,13 @@ func (t *Tunnel) handleHTTP(request *adapters.HTTPAdapter, outbound net.Conn) {
|
||||
break
|
||||
}
|
||||
|
||||
buf := pool.BufPool.Get().([]byte)
|
||||
_, err = io.CopyBuffer(request, resp.Body, buf)
|
||||
pool.BufPool.Put(buf[:cap(buf)])
|
||||
if err != nil && err != io.EOF {
|
||||
break
|
||||
}
|
||||
|
||||
req, err = http.ReadRequest(inboundReeder)
|
||||
if err != nil {
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user