Le 24/01/2020 à 09:17, Willy Tarreau a écrit :
On Fri, Jan 24, 2020 at 08:28:33AM +0100, Christopher Faulet wrote:
Le 23/01/2020 à 19:59, James Brown a écrit :
I spent a couple of minutes and made the attached (pretty bad) patch to
add a del-header-by-prefix.


Just an idea. Instead of adding a new action, it could be cleaner to extend
the del-header action adding some keywords. Something like:

   http-request del-header begin-with <prefix>
   http-request del-header end-with   <sufix>
   http-request del-header match      <regex>

It could be also extended to replace-header and replace-value actions.

I would also prefer to extend existing syntax, however it's problematic
to insert optional words *before* arguments. This will complicate the
parsing, and even config manipulation scripts.

That's why I thought we could instead just append an extra optional
keyword appended after the name, eventhough it's less elegant.


From the configuration parsing point of view, it is more or less the same thing. You must test if the second argument is defined or not. And in fact, moving it after the header name is not a "better" solution because there is an optional condition too at the end. So this one will not be the last one.

For a configuration script, I hope this is easily manageable. Otherwise, I don't know how it could expect to handle all the complexity of the HAProxy configuration.

--
Christopher Faulet

Reply via email to