quatrix: fix Content-Range header
This change does not actually affect uploads. Just to be right according to definition of Content-Range in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range#range-end
This commit is contained in:
parent
885a543023
commit
2abeda5961
1 changed files with 6 additions and 5 deletions
|
@ -1198,11 +1198,12 @@ func (o *Object) uploadSession(ctx context.Context, parentID, name string) (uplo
|
||||||
|
|
||||||
func (o *Object) upload(ctx context.Context, uploadKey string, chunk io.Reader, fullSize int64, offset int64, chunkSize int64, options ...fs.OpenOption) (err error) {
|
func (o *Object) upload(ctx context.Context, uploadKey string, chunk io.Reader, fullSize int64, offset int64, chunkSize int64, options ...fs.OpenOption) (err error) {
|
||||||
opts := rest.Opts{
|
opts := rest.Opts{
|
||||||
Method: "POST",
|
Method: "POST",
|
||||||
RootURL: fmt.Sprintf(uploadURL, o.fs.opt.Host) + uploadKey,
|
RootURL: fmt.Sprintf(uploadURL, o.fs.opt.Host) + uploadKey,
|
||||||
Body: chunk,
|
Body: chunk,
|
||||||
ContentRange: fmt.Sprintf("bytes %d-%d/%d", offset, offset+chunkSize, fullSize),
|
ContentLength: &chunkSize,
|
||||||
Options: options,
|
ContentRange: fmt.Sprintf("bytes %d-%d/%d", offset, offset+chunkSize-1, fullSize),
|
||||||
|
Options: options,
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileID string
|
var fileID string
|
||||||
|
|
Loading…
Reference in a new issue