From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, T_RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E29511F5CD for ; Fri, 13 Mar 2015 01:03:22 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] extras/proxy_pass: remove ERROR_502 constant Date: Fri, 13 Mar 2015 01:03:22 +0000 Message-Id: <1426208602-22883-1-git-send-email-e@80x24.org> List-Id: 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. --- extras/proxy_pass.rb | 4 +--- 1 file changed, 1 insertion(+), 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) -- EW