mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-06 01:23:38 +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 {
|
if err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
adapters.RemoveHopByHopHeaders(resp.Header)
|
adapters.RemoveHopByHopHeaders(resp.Header)
|
||||||
|
|
||||||
if resp.StatusCode == http.StatusContinue {
|
if resp.StatusCode == http.StatusContinue {
|
||||||
@ -59,6 +60,13 @@ func (t *Tunnel) handleHTTP(request *adapters.HTTPAdapter, outbound net.Conn) {
|
|||||||
break
|
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)
|
req, err = http.ReadRequest(inboundReeder)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user