From 690d893af45bce8ac36f8fb739400ee0ff166d2e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 9 May 2015 09:11:29 +0000 Subject: proxy_pass: favor literal hash over arrays for error responses Arrays are less verbose, but they have more bytecode overhead which actually matters at runtime. --- lib/yahns/proxy_pass.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb index 15ae17c..7bbab51 100644 --- a/lib/yahns/proxy_pass.rb +++ b/lib/yahns/proxy_pass.rb @@ -243,6 +243,6 @@ class Yahns::ProxyPass # :nodoc: [ 500, [], [] ] rescue => e Yahns::Log.exception(env['rack.logger'], 'proxy_pass', e) - [ 502, [ %w(Content-Length 0), %w(Content-Type text/plain) ], [] ] + [ 502, { 'Content-Length' => '0', 'Content-Type' => 'text/plain' }, [] ] end end -- cgit v1.2.3-24-ge0c7