diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2020-12-30 20:33:15 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-30 20:33:15 -0800 |
| commit | 8529d56b592630fd0c8a9f84966b3182febd3463 (patch) | |
| tree | 50d2988e809301c2dee2c6f36c2c9671a14d8cf5 | |
| parent | 3433accb1bdb1f311ecba4b87740e853cdfcf93d (diff) | |
| parent | cd2a9865edfe8c0c362d460312d363848fbef7f1 (diff) | |
| download | seaweedfs-8529d56b592630fd0c8a9f84966b3182febd3463.tar.xz seaweedfs-8529d56b592630fd0c8a9f84966b3182febd3463.zip | |
Merge pull request #1720 from PeterCxy/patch-put-respect-mime
filer: respect Content-Type on PUT
| -rw-r--r-- | weed/server/filer_server_handlers_write_autochunk.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go index eee39152b..fe4e68140 100644 --- a/weed/server/filer_server_handlers_write_autochunk.go +++ b/weed/server/filer_server_handlers_write_autochunk.go @@ -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 { |
