diff options
author | Konstantin Haase <konstantin.mailinglists@googlemail.com> | 2014-10-02 15:35:27 +0200 |
---|---|---|
committer | Konstantin Haase <konstantin.mailinglists@googlemail.com> | 2014-10-02 15:35:27 +0200 |
commit | ab172af1b63f0d8e91ce579dd2907c43b96cf82a (patch) | |
tree | 991037ede0df148b5aef7137f321591401f98d53 /lib/rack/showstatus.rb | |
parent | a71be3c914c10d1089238f4e21b029b885be4029 (diff) | |
parent | dc53a8c26dc55d21240233b3d83d36efdef6e924 (diff) | |
download | rack-ab172af1b63f0d8e91ce579dd2907c43b96cf82a.tar.gz |
Merge pull request #737 from schneems/schneems/less-objects
Less allocated objects on each request
Diffstat (limited to 'lib/rack/showstatus.rb')
-rw-r--r-- | lib/rack/showstatus.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rack/showstatus.rb b/lib/rack/showstatus.rb index 6892a5b7..4426310a 100644 --- a/lib/rack/showstatus.rb +++ b/lib/rack/showstatus.rb @@ -3,7 +3,7 @@ require 'rack/request' require 'rack/utils' module Rack - # Rack::ShowStatus catches all empty responses and replaces them + # Rack::ShowStatus catches all empty responses and replaces them # with a site explaining the error. # # Additional details can be put into <tt>rack.showstatus.detail</tt> @@ -19,7 +19,7 @@ module Rack def call(env) status, headers, body = @app.call(env) headers = Utils::HeaderHash.new(headers) - empty = headers['Content-Length'].to_i <= 0 + empty = headers[CONTENT_LENGTH].to_i <= 0 # client or server error, or explicit message if (status.to_i >= 400 && empty) || env["rack.showstatus.detail"] @@ -35,7 +35,7 @@ module Rack body = @template.result(binding) size = Rack::Utils.bytesize(body) - [status, headers.merge("Content-Type" => "text/html", "Content-Length" => size.to_s), [body]] + [status, headers.merge(CONTENT_TYPE => "text/html", CONTENT_LENGTH => size.to_s), [body]] else [status, headers, body] end |