diff --git a/internal/s3/minio.go b/internal/s3/minio.go index f526382..ea4f7fc 100644 --- a/internal/s3/minio.go +++ b/internal/s3/minio.go @@ -65,5 +65,6 @@ func (m *minioClient) GetObjectMetadata(ctx context.Context, key string) (*types return &types.Metadata{ Size: object.Size, ContentType: object.ContentType, + ETag: object.ETag, }, nil } diff --git a/internal/types/types.go b/internal/types/types.go index 53ab430..588d605 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -18,4 +18,5 @@ type Metadata struct { Size int64 ContentType string Filename string + ETag string } diff --git a/internal/web/web.go b/internal/web/web.go index 7a3e76f..52fe838 100644 --- a/internal/web/web.go +++ b/internal/web/web.go @@ -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-Length", strconv.FormatInt(metadata.Size, 10)) w.Header().Set("Content-Disposition", "attachment; filename=\""+metadata.Filename+"\"") + if metadata.ETag != "" { + w.Header().Set("ETag", metadata.ETag) + } return share }