Browse Source

set accept-encoding if empty

Signed-off-by: changlin.shi <changlin.shi@ly.com>
pull/5936/head
changlin.shi 2 years ago
parent
commit
3b69ce6c3d
  1. 7
      weed/s3api/s3api_object_handlers.go

7
weed/s3api/s3api_object_handlers.go

@ -376,6 +376,13 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des
s3a.maybeAddFilerJwtAuthorization(proxyReq, isWrite)
resp, postErr := s3a.client.Do(proxyReq)
if resp.Uncompressed && r.Header.Get("Accept-Encoding") == "" {
r.Header.Set("Accept-Encoding", "gzip")
util.CloseResponse(resp)
s3a.proxyToFiler(w, r, destUrl, false, passThroughResponse)
return
}
if postErr != nil {
glog.Errorf("post to filer: %v", postErr)
s3err.WriteErrorResponse(w, r, s3err.ErrInternalError)

Loading…
Cancel
Save