about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-03-13 00:35:14 +0000
committerEric Wong <e@80x24.org>2015-03-13 01:35:58 +0000
commit691be1228d039dd8c4fa76b0dca644d22831d036 (patch)
tree02b1f2072c4cf3c452ad2303f1863276faa68019
parent14fc235744501b5dd9e176921e4dccdd9324f6db (diff)
downloadyahns-691be1228d039dd8c4fa76b0dca644d22831d036.tar.gz
Some middlewares may attempt to modify the response body in
place, so sharing this is not a good idea.  We shouldn't
really care about rare 502 error paths, either.
-rw-r--r--extras/proxy_pass.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/extras/proxy_pass.rb b/extras/proxy_pass.rb
index ac01c34..08f9730 100644
--- a/extras/proxy_pass.rb
+++ b/extras/proxy_pass.rb
@@ -16,8 +16,6 @@ require 'timeout'
 # cheap on GNU/Linux...
 # This is totally untested but currently doesn't serve anything important.
 class ProxyPass # :nodoc:
-  ERROR_502 = [ 502, {'Content-Length'=>'0','Content-Type'=>'text/plain'}, [] ]
-
   class ConnPool
     def initialize
       @mtx = Mutex.new
@@ -187,7 +185,7 @@ class ProxyPass # :nodoc:
       logger = env['rack.logger'] and
         Yahns::Log.exception(logger, 'proxy_pass', e)
     end
-    ERROR_502
+    [ 502, [ %w(Content-Length 0), %w(Content-Type text/plain) ], [] ]
   end
 
   def send_body(input, ures, chunked)