mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-19 20:26:26 +08:00
feat(s3): add Content-Disposition header (#365)
* add(s3): add Content-Disposition header * Update driver.go Signed-off-by: XZB-1248 <28593573+XZB-1248@users.noreply.github.com> * Update driver.go Signed-off-by: XZB-1248 <28593573+XZB-1248@users.noreply.github.com> --------- Signed-off-by: XZB-1248 <28593573+XZB-1248@users.noreply.github.com> Co-authored-by: XZB-1248 <i@1248.ink> Co-authored-by: Suyunjing <69945917+Suyunmeng@users.noreply.github.com>
This commit is contained in:
@ -213,8 +213,9 @@ func (b *s3Backend) GetObject(ctx context.Context, bucketName, objectName string
|
||||
}
|
||||
|
||||
meta := map[string]string{
|
||||
"Last-Modified": node.ModTime().Format(timeFormat),
|
||||
"Content-Type": utils.GetMimeType(fp),
|
||||
"Last-Modified": node.ModTime().Format(timeFormat),
|
||||
"Content-Disposition": utils.GenerateContentDisposition(file.GetName()),
|
||||
"Content-Type": utils.GetMimeType(fp),
|
||||
}
|
||||
|
||||
if val, ok := b.meta.Load(fp); ok {
|
||||
@ -328,7 +329,7 @@ func (b *s3Backend) PutObject(
|
||||
func (b *s3Backend) DeleteMulti(ctx context.Context, bucketName string, objects ...string) (result gofakes3.MultiDeleteResult, rerr error) {
|
||||
for _, object := range objects {
|
||||
if err := b.deleteObject(ctx, bucketName, object); err != nil {
|
||||
utils.Log.Errorf("serve s3", "delete object failed: %v", err)
|
||||
log.Errorf("delete object failed: %v", err)
|
||||
result.Error = append(result.Error, gofakes3.ErrorResult{
|
||||
Code: gofakes3.ErrInternal,
|
||||
Message: gofakes3.ErrInternal.Message(),
|
||||
|
Reference in New Issue
Block a user