Update: I rebased back to the last non-segfaulting commit and this patch's
functionality appears to work in very limited testing.

On Thu, Jan 23, 2020 at 10:59 AM James Brown <jbr...@easypost.com> wrote:

> I spent a couple of minutes and made the attached (pretty bad) patch to
> add a del-header-by-prefix.
>
> Unfortunately, I made it off of master before noticing that master
> segfaults on every request, so I haven't tested it yet. At least it
> compiles... Feel free to use it, throw it away, or whatever else suits your
> fancy.
>
>
>
> On Thu, Jan 23, 2020 at 9:26 AM James Brown <jbr...@easypost.com> wrote:
>
>> Yes, they’re all identified by a prefix.
>>
>> On Thu, Jan 23, 2020 at 02:03 Willy Tarreau <w...@1wt.eu> wrote:
>>
>>> Hi James,
>>>
>>> On Wed, Jan 22, 2020 at 04:19:41PM -0800, James Brown wrote:
>>> > We're upgrading from 1.8 to 2.x and one of the things I've noticed is
>>> that
>>> > reqidel and rspidel seem to be totally gone in 2.1... What's the new
>>> > recommendation to delete headers from request/response based on a
>>> regular
>>> > expression? Do I have to write a Lua action to do this now? I read
>>> through
>>> > the documentation for http-request and http-response and there doesn't
>>> seem
>>> > to be an `http-request del-header-by-regex`...
>>> >
>>> > Our use case is that we have dozens of different internal headers
>>> behind a
>>> > prefix, and we promise that we'll strip them all for incoming requests
>>> and
>>> > outgoing responses at the edge load balancer. That is harder to do if
>>> we
>>> > can't delete all headers matching a certain regex...
>>>
>>> That's an intereting use case, which I find totally legitimate and that
>>> we need to figure how to address. In 2.0 you can still rely on rspdel
>>> but we then need to have a solution for 2.2. Probably that in the short
>>> term using Lua will be the easiest solution. And maybe we'd need to add
>>> a new action such as "del-headers" which would take a regex or a prefix.
>>> By the way, are all your headers identified by the same prefix ? I'm
>>> asking because if that's the case, maybe we could append an optional
>>> argument to del-header to mention that we want to delete all those
>>> starting with this prefix and not just this exact one.
>>>
>>> Willy
>>>
>> --
>> James Brown
>> Engineer
>>
>
>
> --
> James Brown
> Engineer
>


-- 
James Brown
Engineer

Reply via email to