mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 11:44:45 -06:00
Close the response body when 301 is returned in the WebDAV backend
This commit is contained in:
@@ -174,12 +174,13 @@ func (storage *WebDAVStorage) sendRequest(method string, uri string, depth int,
|
|||||||
return response.Body, response.Header, nil
|
return response.Body, response.Header, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
io.Copy(ioutil.Discard, response.Body)
|
||||||
|
response.Body.Close()
|
||||||
|
|
||||||
if response.StatusCode == 301 {
|
if response.StatusCode == 301 {
|
||||||
return nil, nil, errWebDAVMovedPermanently
|
return nil, nil, errWebDAVMovedPermanently
|
||||||
}
|
}
|
||||||
|
|
||||||
io.Copy(ioutil.Discard, response.Body)
|
|
||||||
response.Body.Close()
|
|
||||||
if response.StatusCode == 404 {
|
if response.StatusCode == 404 {
|
||||||
// Retry if it is UPLOAD, otherwise return immediately
|
// Retry if it is UPLOAD, otherwise return immediately
|
||||||
if method != "PUT" {
|
if method != "PUT" {
|
||||||
|
|||||||
Reference in New Issue
Block a user