4. Interceptors/Features

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, stompProxy, swaggerProxy, if, registration, wsStompReassembler, interceptor, bean, internalProxy, transport and soapProxy

Syntax

<headerFilter>
    <include>{regex-pattern}</include>
    <exclude>{regex-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..*