diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-06-27 23:51:55 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-06-27 23:51:55 +0000 |
commit | 8756eac8c0e993caa6f704e27985405f6c9dfa7d (patch) | |
tree | 6093d54b8d081ffce166264302bb1ef574ffc00c /lib/rainbows/http_response.rb | |
parent | 43745f26e201655f98351684e1d357cbd8c15b05 (diff) | |
download | rainbows-8756eac8c0e993caa6f704e27985405f6c9dfa7d.tar.gz |
Diffstat (limited to 'lib/rainbows/http_response.rb')
-rw-r--r-- | lib/rainbows/http_response.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/rainbows/http_response.rb b/lib/rainbows/http_response.rb index 5552c30..fdbf3dd 100644 --- a/lib/rainbows/http_response.rb +++ b/lib/rainbows/http_response.rb @@ -8,8 +8,7 @@ class Rainbows::HttpResponse < ::Unicorn::HttpResponse status = CODES[status.to_i] || status headers.each do |key, value| - next if %r{\AX-Rainbows-}i =~ key - next if SKIP.include?(key.downcase) + next if %r{\A(?:X-Rainbows-|Connection\z|Date\z|Status\z)}i =~ key if value =~ /\n/ # avoiding blank, key-only cookies with /\n+/ out.concat(value.split(/\n+/).map! { |v| "#{key}: #{v}\r\n" }) @@ -26,8 +25,7 @@ class Rainbows::HttpResponse < ::Unicorn::HttpResponse def self.write(socket, rack_response, out = []) status, headers, body = rack_response - out.instance_of?(Array) and - socket.write(header_string(status, headers, out)) + out and socket.write(header_string(status, headers, out)) body.each { |chunk| socket.write(chunk) } ensure |