mirror of
https://github.com/gospider007/requests.git
synced 2025-12-24 13:57:52 +08:00
sync
This commit is contained in:
5
http.go
5
http.go
@@ -78,7 +78,10 @@ func (obj *clientConn) send() {
|
||||
defer func() {
|
||||
obj.task.readCnl(readErr)
|
||||
}()
|
||||
_, readErr = io.Copy(pw, rawBody)
|
||||
noBody := obj.task.res.ContentLength == -1 && len(obj.task.res.TransferEncoding) == 0
|
||||
if !noBody {
|
||||
_, readErr = io.Copy(pw, rawBody)
|
||||
}
|
||||
pw.CloseWithError(readErr)
|
||||
if readErr != nil && readErr != io.EOF && readErr != io.ErrUnexpectedEOF {
|
||||
obj.task.err = tools.WrapError(readErr, "failed to read response body")
|
||||
|
||||
Reference in New Issue
Block a user