-
Notifications
You must be signed in to change notification settings - Fork 653
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
No way to get non-metadata headers (e.g. content-range) from StatObject #1993
Comments
@skirsten Which headers are you missing? |
Please share code, and don't leave us speculating. |
Sorry, here is a complete example: mc, err := minio.NewCore("...", &minio.Options{
Creds: credentials.NewStaticV4("...", "...", ""),
Secure: true,
})
if err != nil {
return err
}
options := minio.GetObjectOptions{}
err = options.SetRange(0, 100)
if err != nil {
return err
}
// For GET we get the headers returned
obj, stat, headers, err := mc.GetObject(ctx, "bucket", "object", options)
if err != nil {
return err
}
defer obj.Close()
// Need to get the contentRange to get the total size and the actual range that was returned by S3
contentRange := headers.Get("content-range")
fmt.Printf("read size: %d\n", stat.Size)
fmt.Printf("content-range (start-end/total): %s\n", contentRange)
// For the HEAD the headers do not get returned
stat, err = mc.StatObject(ctx, "bucket", "path", options)
if err != nil {
return err
}
fmt.Printf("read size: %d\n", stat.Size)
return fmt.Errorf("no way to get the headers of the StatObject response") |
It would need to be included in the ObjectInfo. Parsing Range headers is quite a nightmare, though that would probably be the path to take. |
The
minio.Core
GetObject
returns the headers but theStatObject
does not.As far as I can tell there is no way to get the headers that are not parsed into
stat.Metadata
andstat.UserMetadata
for the HEAD method.The text was updated successfully, but these errors were encountered: