Skip to content

Commit e2f4234

Browse files
committed
fix(onedrive_app): set req.ContentLength
1 parent e4b6c77 commit e2f4234

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/onedrive_app/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"io"
99
"net/http"
1010
stdpath "path"
11-
"strconv"
1211

1312
"github.com/alist-org/alist/v3/drivers/base"
1413
"github.com/alist-org/alist/v3/internal/driver"
@@ -176,7 +175,8 @@ func (d *OnedriveAPP) upBig(ctx context.Context, dstDir model.Obj, stream model.
176175
return err
177176
}
178177
req = req.WithContext(ctx)
179-
req.Header.Set("Content-Length", strconv.Itoa(int(byteSize)))
178+
req.ContentLength = byteSize
179+
// req.Header.Set("Content-Length", strconv.Itoa(int(byteSize)))
180180
req.Header.Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", finish, finish+byteSize-1, stream.GetSize()))
181181
finish += byteSize
182182
res, err := base.HttpClient.Do(req)

0 commit comments

Comments
 (0)