Browse Source

adjust mime detection

pull/2395/head
Chris Lu 3 years ago
parent
commit
a6bb509cb7
  1. 2
      weed/s3api/s3api_object_handlers.go

2
weed/s3api/s3api_object_handlers.go

@ -41,7 +41,7 @@ func mimeDetect(r *http.Request, dataReader io.Reader) io.ReadCloser {
mimeBuffer := make([]byte, 512)
size, _ := dataReader.Read(mimeBuffer)
if size > 0 {
r.Header.Set("Content-Type", http.DetectContentType(mimeBuffer))
r.Header.Set("Content-Type", http.DetectContentType(mimeBuffer[:size]))
return io.NopCloser(io.MultiReader(bytes.NewReader(mimeBuffer[:size]), dataReader))
}
return io.NopCloser(dataReader)

Loading…
Cancel
Save