1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-04 16:16:58 +02:00

filer: respect Content-Type on PUT

This is needed for the S3 gateway to conform to the S3 protocol -- the
server should always respect the Content-Type set by client.
This commit is contained in:
Peter Cai 2020-12-31 11:32:45 +08:00
parent 3433accb1b
commit cd2a9865ed

View file

@ -111,7 +111,10 @@ func (fs *FilerServer) doPostAutoChunk(ctx context.Context, w http.ResponseWrite
func (fs *FilerServer) doPutAutoChunk(ctx context.Context, w http.ResponseWriter, r *http.Request, chunkSize int32, so *operation.StorageOption) (filerResult *FilerPostResult, md5bytes []byte, replyerr error) {
fileName := ""
contentType := ""
contentType := r.Header.Get("Content-Type")
if contentType == "application/octet-stream" {
contentType = ""
}
fileChunks, md5Hash, chunkOffset, err, smallContent := fs.uploadReaderToChunks(w, r, r.Body, chunkSize, fileName, contentType, so)
if err != nil {