-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable stat operations for specific ranges #1846
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! That is more in line with the change I expected.
Please fix the tests @r-scheele |
|
Merge master into stat-for-specific-range
Hi @harshavardhana @klauspost please review again |
delete(opts.headers, "Range") | ||
objectInfo, err = c.StatObject(gctx, bucketName, objectName, StatObjectOptions(opts)) | ||
if err != nil { | ||
_, rangeHeaderPresent := opts.headers["Range"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_, rangeHeaderPresent := opts.headers["Range"] | |
_, ok := opts.headers["Range"] |
objectInfo, err = c.StatObject(gctx, bucketName, objectName, StatObjectOptions(opts)) | ||
if err != nil { | ||
_, rangeHeaderPresent := opts.headers["Range"] | ||
if rangeHeaderPresent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if rangeHeaderPresent { | |
if ok { |
} | ||
} else { | ||
// The range header is not present, continue with the existing objectInfo. | ||
delete(opts.headers, "Range") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete(opts.headers, "Range") |
Not needed in else {
ref issue number: #1813
Stat()
was designed to always work on the original file size, and not a portion of the object