diff options
author | Arthur Nogueira Neves <github@arthurnn.com> | 2015-03-12 11:40:18 -0400 |
---|---|---|
committer | Arthur Nogueira Neves <github@arthurnn.com> | 2015-03-12 11:40:18 -0400 |
commit | ba7e5530d808e14f0cd135480bb7673bca78d3fe (patch) | |
tree | 304a15196f00198ed360f51d12cd0e7f21e4a4ac /actionpack/lib/action_dispatch | |
parent | 2ad6502787b8d2acf2f5971068f0623cf36ed25f (diff) | |
parent | b60c1fe97be3af8baf982aaa4638811a37f7a7e9 (diff) | |
download | rails-ba7e5530d808e14f0cd135480bb7673bca78d3fe.tar.gz rails-ba7e5530d808e14f0cd135480bb7673bca78d3fe.tar.bz2 rails-ba7e5530d808e14f0cd135480bb7673bca78d3fe.zip |
Merge pull request #19271 from eagletmt/304-content-type
304 response should not include Content-Type header
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/static.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb index 2e1bd45c3d..fdd1bc4e69 100644 --- a/actionpack/lib/action_dispatch/middleware/static.rb +++ b/actionpack/lib/action_dispatch/middleware/static.rb @@ -47,6 +47,9 @@ module ActionDispatch if gzip_path && gzip_encoding_accepted?(env) env['PATH_INFO'] = gzip_path status, headers, body = @file_server.call(env) + if status == 304 + return [status, headers, body] + end headers['Content-Encoding'] = 'gzip' headers['Content-Type'] = content_type(path) else |