Remove one item from multivalue header

I faced the Brotli encoding issue which I tried to fix using the solution described here: Unsupported Encoding "br". This solution is working fine but there is design flaw. The right approach would be to remove the 'br' value from the list of accepted encodings instead of totally overwriting the values of the original request. In this case probably it does not cause any problem but there might be other use-cases where we don't want to specify all the values in the proxy but remove those which are not supported.

I tried AssignMessage policy with Remove. The documentation looks like this:

  <Remove>
    <!-- Can also be an empty array (<Headers/>) -->
    <Headers>
      <Header name="header_name">header_value</Header>
      ...
    </Headers>
  </Remove>

I assumed that setting br as header_value will remove only br from the list of values and leave gzip, deflate in place. Instead the whole header was removed.

What is the point of specifying header_value in case of Remove?
How do I remove just one specific value from a multivalue header?

1 1 179
1 REPLY 1

What is the point of specifying header_value in case of Remove?

There is no point. The text value of that element is ignored. The Remove/Headers/Header just removes the header with the given name.

How do I remove just one specific value from a multivalue header?

You'd need to do some custom parsing, I suppose in JavaScript.