fix(s3): throw error is content length is missing (fix #3394)

This commit is contained in:
Aaron Liu
2026-05-09 11:17:40 +08:00
parent 8acc57420a
commit 9792a5c84f

View File

@@ -422,6 +422,10 @@ func (handler *Driver) Meta(ctx context.Context, path string) (*MetaData, error)
return nil, err
}
if res == nil || res.ContentLength == nil {
return nil, errors.New("invalid response from S3: missing ContentLength")
}
etag := ""
if res.ETag != nil {
etag = *res.ETag