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/content_length.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/content_length.rb')
-rw-r--r-- | lib/rack/content_length.rb | 4 |
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] |