added etag to metadata
This commit is contained in:
parent
b5a326324f
commit
a11349e456
@ -65,5 +65,6 @@ func (m *minioClient) GetObjectMetadata(ctx context.Context, key string) (*types
|
|||||||
return &types.Metadata{
|
return &types.Metadata{
|
||||||
Size: object.Size,
|
Size: object.Size,
|
||||||
ContentType: object.ContentType,
|
ContentType: object.ContentType,
|
||||||
|
ETag: object.ETag,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
@ -18,4 +18,5 @@ type Metadata struct {
|
|||||||
Size int64
|
Size int64
|
||||||
ContentType string
|
ContentType string
|
||||||
Filename string
|
Filename string
|
||||||
|
ETag string
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,9 @@ func getShareHead(client client.Client, w http.ResponseWriter, r *http.Request)
|
|||||||
w.Header().Set("Content-Type", metadata.ContentType)
|
w.Header().Set("Content-Type", metadata.ContentType)
|
||||||
w.Header().Set("Content-Length", strconv.FormatInt(metadata.Size, 10))
|
w.Header().Set("Content-Length", strconv.FormatInt(metadata.Size, 10))
|
||||||
w.Header().Set("Content-Disposition", "attachment; filename=\""+metadata.Filename+"\"")
|
w.Header().Set("Content-Disposition", "attachment; filename=\""+metadata.Filename+"\"")
|
||||||
|
if metadata.ETag != "" {
|
||||||
|
w.Header().Set("ETag", metadata.ETag)
|
||||||
|
}
|
||||||
|
|
||||||
return share
|
return share
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user