delete body copy
This commit is contained in:
parent
2e315b1b52
commit
1f673f991f
13
response.go
13
response.go
|
@ -4,7 +4,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"compress/zlib"
|
"compress/zlib"
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
@ -25,14 +24,14 @@ func FromHTTPResponse(resp *http.Response) (*Response, error) {
|
||||||
}
|
}
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
|
|
||||||
cbuf := bytes.NewBuffer([]byte{})
|
// cbuf := bytes.NewBuffer([]byte{})
|
||||||
_, err = io.Copy(cbuf, bytes.NewReader(srcbuf))
|
// _, err = io.Copy(cbuf, bytes.NewReader(srcbuf))
|
||||||
|
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
|
|
||||||
resp.Body = ioutil.NopCloser(cbuf)
|
// resp.Body = ioutil.NopCloser(cbuf)
|
||||||
|
|
||||||
content := string(srcbuf)
|
content := string(srcbuf)
|
||||||
srcReader := bytes.NewReader(srcbuf)
|
srcReader := bytes.NewReader(srcbuf)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user