Browse Source

Merge pull request #109 from agin719/cos-v4-dev

update
master
agin719 4 years ago
committed by GitHub
parent
commit
13b56ff05d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      object.go

7
object.go

@ -771,6 +771,13 @@ func (s *ObjectService) Upload(ctx context.Context, name string, filepath string
Key: name,
ETag: rsp.Header.Get("ETag"),
}
if rsp != nil && opt.EnableVerification {
scoscrc := rsp.Header.Get("x-cos-hash-crc64ecma")
icoscrc, _ := strconv.ParseUint(scoscrc, 10, 64)
if icoscrc != localcrc {
return result, rsp, fmt.Errorf("verification failed, want:%v, return:%v", localcrc, icoscrc)
}
}
return result, rsp, nil
}

Loading…
Cancel
Save