summary refs log tree commit
path: root/lib/rack/content_length.rb
diff options
context:
space:
mode:
authorKonstantin Haase <konstantin.mailinglists@googlemail.com>2014-10-02 15:35:27 +0200
committerKonstantin Haase <konstantin.mailinglists@googlemail.com>2014-10-02 15:35:27 +0200
commitab172af1b63f0d8e91ce579dd2907c43b96cf82a (patch)
tree991037ede0df148b5aef7137f321591401f98d53 /lib/rack/content_length.rb
parenta71be3c914c10d1089238f4e21b029b885be4029 (diff)
parentdc53a8c26dc55d21240233b3d83d36efdef6e924 (diff)
downloadrack-ab172af1b63f0d8e91ce579dd2907c43b96cf82a.tar.gz
Merge pull request #737 from schneems/schneems/less-objects
Less allocated objects on each request
Diffstat (limited to 'lib/rack/content_length.rb')
-rw-r--r--lib/rack/content_length.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rack/content_length.rb b/lib/rack/content_length.rb
index 71bc919b..d0f491d1 100644
--- a/lib/rack/content_length.rb
+++ b/lib/rack/content_length.rb
@@ -16,7 +16,7 @@ module Rack
       headers = HeaderHash.new(headers)
 
       if !STATUS_WITH_NO_ENTITY_BODY.include?(status.to_i) &&
-         !headers['Content-Length'] &&
+         !headers[CONTENT_LENGTH] &&
          !headers['Transfer-Encoding'] &&
          body.respond_to?(:to_ary)
 
@@ -28,7 +28,7 @@ module Rack
           obody.close if obody.respond_to?(:close)
         end
 
-        headers['Content-Length'] = length.to_s
+        headers[CONTENT_LENGTH] = length.to_s
       end
 
       [status, headers, body]