Browse Source

check request header not part header for content-encoding

pull/1371/head
Kimbsen 5 years ago
parent
commit
6b1e93ba0b
  1. 2
      weed/storage/needle/needle_parse_upload.go

2
weed/storage/needle/needle_parse_upload.go

@ -140,7 +140,7 @@ func parseMultipart(r *http.Request, sizeLimit int64, pu *ParsedUpload) (e error
reader := io.LimitReader(part, sizeLimit+1)
if expectedChecksum := r.Header.Get("Content-MD5"); expectedChecksum != "" {
if part.Header.Get("Content-Encoding") == "gzip" {
if r.Header.Get("Content-Encoding") == "gzip" {
gr, err := gzip.NewReader(reader)
if err != nil {
e = fmt.Errorf("Content-Encoding == gzip but content was not gzipped: %s", err)

Loading…
Cancel
Save