about summary refs log tree commit homepage
path: root/extras/try_gzip_static.rb
diff options
context:
space:
mode:
Diffstat (limited to 'extras/try_gzip_static.rb')
-rw-r--r--extras/try_gzip_static.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/extras/try_gzip_static.rb b/extras/try_gzip_static.rb
index ed561cb..d412589 100644
--- a/extras/try_gzip_static.rb
+++ b/extras/try_gzip_static.rb
@@ -216,8 +216,9 @@ class TryGzipStatic
     if Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include?(code)
       [ code, {}, [] ]
     else
-      h = { 'Content-Type' => 'text/plain', 'Content-Length' => '0' }
-      [ code, h, [] ]
+      msg = "#{code} #{Rack::Utils::HTTP_STATUS_CODES[code.to_i]}\n"
+      h = { 'Content-Type' => 'text/plain', 'Content-Length' => msg.size.to_s }
+      [ code, h, [ msg ] ]
     end
   end
 end