Willy,

Am 16.05.19 um 11:12 schrieb Willy Tarreau:
>> Both frontends will do the correct replacement, but IMO the reqrep one
>> is more readable (not that any of these are really readable):
> 
> I'm having a different view on this. The one using the headers hack is
> horrible while the reqrep one is simply ugly :-)

I'm fine with that view :-)

> Really, this is a good reason for having a "replace-uri" action. It should
> mostly be a copy-paste of the replace-header code but applied to the URI,
> and will be much simpler and safer to use than any of the tricks above.

Yes, definitely.

>> The obvious `http-request set-path %[path,regsub(...)]` as suggested in
>> the docs for `http-request set-query` does *NOT* work, because the
>> `regsub` parameters cannot contain the closing parenthesis required for
>> capture groups.
> 
> Yep I see. I've added feature request #100 to keep track of this. I'm

Perfect.

> willing to merge this even late into 2.0 and to make sure we can warn
> on rsp/req*. Just let me know if you're interested. Also feel free to

Generally yes, but I'll have to see whether I have time to dive into
that before the release. So if someone beats me to it: Even better for
me (or rather everyone).

> add replace-path to replace only the path component as I suspect it could
> be useful as well.

I guess for completeness it makes sense, but it can easily be emulated
with replace-uri:

http-request replace-uri ([^?]*)(?(.*))? /\1/whatever/\2

So the important one is replace-uri, but I guess that it's not too hard
to add that one as well.

> Oh BTW I've merged your 6 patches into the "next" branch and merged two
> of them into master.
> 

Perfect.

Best regards
Tim Düsterhus

Reply via email to