2. Enterprise Integration Patterns

headerFilter

Removes message headers matching a list of patterns. The first matching child element will be acted upon by the filter.

Can be used in:

serviceProxy, api, global, chainDef, for, stompProxy, if, registration, wsStompReassembler, internal, interceptor, chain, bean, transport and soapProxy

Syntax

<headerFilter>
  [<include>pattern</include> | <exclude>pattern</exclude>]...
</headerFilter>

Sample

In the example, only headers starting with Content or the Location header will be kept; all others will be removed from requests and responses.

<api port="80">
    <headerFilter>
        <include>Content.*<include>
        <include>Location<include>
        <exclude>.*<exclude>
    </headerFilter>
    <target url="https://membrane-api.io" />
</api>

Child Elements

ElementsDescriptionCardinality
exclude List of actions to take (either allowing or removing HTTP headers). 0..*
include List of actions to take (either allowing or removing HTTP headers). 0..*