fix(webdav): sharepoint upload

This commit is contained in:
Xhofe
2022-04-24 15:38:17 +08:00
parent e4df146043
commit 42c0e438d5
4 changed files with 14 additions and 9 deletions

View File

@ -192,13 +192,14 @@ func (c *Client) copymove(method string, oldpath string, newpath string, overwri
return newPathError(method, oldpath, s)
}
func (c *Client) put(path string, stream io.Reader) (status int, err error) {
rs, err := c.req("PUT", path, stream, nil)
func (c *Client) put(path string, stream io.Reader, callback func(r *http.Request)) (status int, err error) {
rs, err := c.req("PUT", path, stream, callback)
if err != nil {
return
}
defer rs.Body.Close()
//all, _ := io.ReadAll(rs.Body)
//logrus.Debugln("put res: ", string(all))
status = rs.StatusCode
return
}