mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
S3 MultipartUpload pass contentType to meta
This commit is contained in:
parent
de1ec050e8
commit
458145425e
|
@ -38,6 +38,9 @@ func (s3a *S3ApiServer) createMultipartUpload(input *s3.CreateMultipartUploadInp
|
||||||
for k, v := range input.Metadata {
|
for k, v := range input.Metadata {
|
||||||
entry.Extended[k] = []byte(*v)
|
entry.Extended[k] = []byte(*v)
|
||||||
}
|
}
|
||||||
|
if input.ContentType != nil {
|
||||||
|
entry.Attributes.Mime = *input.ContentType
|
||||||
|
}
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
glog.Errorf("NewMultipartUpload error: %v", err)
|
glog.Errorf("NewMultipartUpload error: %v", err)
|
||||||
return nil, s3err.ErrInternalError
|
return nil, s3err.ErrInternalError
|
||||||
|
@ -121,6 +124,9 @@ func (s3a *S3ApiServer) completeMultipartUpload(input *s3.CompleteMultipartUploa
|
||||||
entry.Extended[k] = v
|
entry.Extended[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if pentry.Attributes.Mime != "" {
|
||||||
|
entry.Attributes.Mime = pentry.Attributes.Mime
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -36,6 +36,10 @@ func (s3a *S3ApiServer) NewMultipartUploadHandler(w http.ResponseWriter, r *http
|
||||||
createMultipartUploadInput.Metadata[k] = aws.String(string(v))
|
createMultipartUploadInput.Metadata[k] = aws.String(string(v))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contentType := r.Header.Get("Content-Type")
|
||||||
|
if contentType != "" {
|
||||||
|
createMultipartUploadInput.ContentType = &contentType
|
||||||
|
}
|
||||||
response, errCode := s3a.createMultipartUpload(createMultipartUploadInput)
|
response, errCode := s3a.createMultipartUpload(createMultipartUploadInput)
|
||||||
|
|
||||||
glog.V(2).Info("NewMultipartUploadHandler", string(s3err.EncodeXMLResponse(response)), errCode)
|
glog.V(2).Info("NewMultipartUploadHandler", string(s3err.EncodeXMLResponse(response)), errCode)
|
||||||
|
|
Loading…
Reference in a new issue