aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/middleware/static.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb
index f5c2acbfb9..fdd1bc4e69 100644
--- a/actionpack/lib/action_dispatch/middleware/static.rb
+++ b/actionpack/lib/action_dispatch/middleware/static.rb
@@ -47,10 +47,11 @@ module ActionDispatch
if gzip_path && gzip_encoding_accepted?(env)
env['PATH_INFO'] = gzip_path
status, headers, body = @file_server.call(env)
- headers['Content-Encoding'] = 'gzip'
- if status != 304
- headers['Content-Type'] = content_type(path)
+ if status == 304
+ return [status, headers, body]
end
+ headers['Content-Encoding'] = 'gzip'
+ headers['Content-Type'] = content_type(path)
else
status, headers, body = @file_server.call(env)
end