From 44cf14154165c85e8081c51d3d01a6c690cc9e7a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 4 Jun 2015 01:06:41 +0000 Subject: http_response: simplify regular expression It's ugly and less-readable to have redundant \z statements, and according to ObjectSpace.memsize_of, this saves 4 bytes on x86-64. --- lib/unicorn/http_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb index c9c2de8..801bf9a 100644 --- a/lib/unicorn/http_response.rb +++ b/lib/unicorn/http_response.rb @@ -33,7 +33,7 @@ module Unicorn::HttpResponse "Connection: close\r\n" headers.each do |key, value| case key - when %r{\A(?:Date\z|Connection\z)}i + when %r{\A(?:Date|Connection)\z}i next when "rack.hijack" # This should only be hit under Rack >= 1.5, as this was an illegal -- cgit v1.2.3-24-ge0c7