diff options
author | Kohei Suzuki <eagletmt@gmail.com> | 2015-03-10 16:51:51 +0900 |
---|---|---|
committer | Kohei Suzuki <eagletmt@gmail.com> | 2015-03-10 23:39:08 +0900 |
commit | d4103fc232044625c6ba4692b4c9bd8779e97ba5 (patch) | |
tree | bb6475ff3928e412b69347b31bf9d10e772651e5 /actionpack/lib | |
parent | 221e847a3bc4b6dc2559b4354417862b2e6c684a (diff) | |
download | rails-d4103fc232044625c6ba4692b4c9bd8779e97ba5.tar.gz rails-d4103fc232044625c6ba4692b4c9bd8779e97ba5.tar.bz2 rails-d4103fc232044625c6ba4692b4c9bd8779e97ba5.zip |
304 response should not include Content-Type header
Rack::Lint raises an error saying "Content-Type header found in 304
response, not allowed".
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/static.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb index 2e1bd45c3d..f5c2acbfb9 100644 --- a/actionpack/lib/action_dispatch/middleware/static.rb +++ b/actionpack/lib/action_dispatch/middleware/static.rb @@ -48,7 +48,9 @@ module ActionDispatch env['PATH_INFO'] = gzip_path status, headers, body = @file_server.call(env) headers['Content-Encoding'] = 'gzip' - headers['Content-Type'] = content_type(path) + if status != 304 + headers['Content-Type'] = content_type(path) + end else status, headers, body = @file_server.call(env) end |