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: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-1.1 required=3.0 tests=AWL,BAYES_00,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id F0DFE200CE for ; Wed, 8 Apr 2015 17:23:34 +0000 (UTC) Received: by labbd9 with SMTP id bd9so59836618lab.2 for ; Wed, 08 Apr 2015 10:23:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=Rz0olgfczvprZKuU/uYSmWd5LYuSm3c5oTJC7xY8aY8=; b=JcuwLmW6qgz4GEtNnSmdqyurgQ07sIlQLs2OGCSHrE6f+eSTtPyW3regcVOObuhpp4 uIxr3l4VRMxaVTp5AReFAE4pK/TMs2+DEYC7ASz4ImAIPipUMtVJs0C5XfrwAZdX8Uc8 Gb4/kQi2I5jgssIFlSnP/tH1UZH87jr71dfyuzXGNnAQDrn6h25wB0ktdvsgxP4FIEG4 IDf8gfskeoze+JP7GC1uIw9whC+PEQlinjyjD6cZ2hBoY3IieKnYzH7w91xZMV4Ig6tj DN6adlGWLCI6R1CINRho3rV9YyXAHY8t9pkaCwPxOymhuh9ofbnd9aEK8QEvP4JUvC0q PHIQ== X-Gm-Message-State: ALoCoQnGm1G9BmjktwNTXfwC6T6pNn209a2flVeKSxmWBWt0GVyK4QKA3XIyyD6XXPhyU28IjP0g X-Received: by 10.152.29.6 with SMTP id f6mr811079lah.85.1428513813040; Wed, 08 Apr 2015 10:23:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.159.34 with HTTP; Wed, 8 Apr 2015 10:23:02 -0700 (PDT) In-Reply-To: <20150408170328.GA10903@dcvr.yhbt.net> References: <20150407213431.GA20108@dcvr.yhbt.net> <20150408170328.GA10903@dcvr.yhbt.net> From: "Lin Jen-Shin (godfat)" Date: Thu, 9 Apr 2015 01:23:02 +0800 Message-ID: Subject: Re: [RFC] proxy_pass: possibly avoid breaking some middlewares To: Eric Wong Cc: yahns-public@yhbt.net Content-Type: text/plain; charset=UTF-8 List-Id: On Thu, Apr 9, 2015 at 1:03 AM, Eric Wong wrote: > "Lin Jen-Shin (godfat)" wrote: >> On Wed, Apr 8, 2015 at 5:34 AM, Eric Wong wrote: >> > + # this probably breaks fewer middlewares than returning whatever else... >> > + [ 500, [], [] ] >> >> You probably meant [ 500, {}, [] ] here? > > No, arrays work fine, Rack headers just need to respond to #each > with key + value strings. I didn't know this, and just looked at the spec. Indeed it's only claiming this. However some middleware bundled with Rack would try to call [ ] method with a string, in those cases, this would probably give a type error. I think the spec should probably also claim that it should respond to [ ] and taking strings as keys. > I prefer Arrays since they use less memory per-entry, but here they're > the same cost when empty. That's great :P > But I'm also likely to revert this patch since it's no longer a drop-in > replacement and the old, synchronous ProxyPass is reinstated. After playing a bit with hijack myself, I started to wonder if hijacking is really a good idea, exactly the reason that it would probably break a lot of middleware...