forked from TrueCloudLab/restic
debug: Fix EOF detection in HTTP transport
This commit is contained in:
parent
6301620428
commit
d3c06c39f9
1 changed files with 3 additions and 1 deletions
|
@ -52,7 +52,9 @@ func (rd *eofDetectReader) Close() error {
|
|||
|
||||
func (tr eofDetectRoundTripper) RoundTrip(req *http.Request) (res *http.Response, err error) {
|
||||
res, err = tr.RoundTripper.RoundTrip(req)
|
||||
if res != nil && res.Body != nil {
|
||||
res.Body = &eofDetectReader{rd: res.Body}
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue