Merge pull request #4960 from opf/fix/24111/gzip-double-content-encoding

[24111] Fix double encoding of gzip attachments in Firefox
pull/4968/head
Markus Kahl 8 years ago committed by GitHub
commit 9a58e445d3
  1. 9
      config/application.rb

@ -82,7 +82,14 @@ module OpenProject
# different ETag on every request, Rack::Deflater has to be in the chain of
# middlewares after Rack::ETag. #insert_before is used because on
# responses, the middleware stack is processed from top to bottom.
config.middleware.insert_before Rack::ETag, Rack::Deflater
config.middleware.insert_before Rack::ETag,
Rack::Deflater,
if: lambda { |_env, _code, headers, _body|
# Firefox fails to properly decode gzip attachments
# We thus avoid deflating if sending gzip already.
content_type = headers['Content-Type']
content_type != 'application/x-gzip'
}
config.middleware.use ::ParamsParserWithExclusion,
exclude: -> (env) {

Loading…
Cancel
Save