The Add Header filter adds configured headers to a request and/or response. You can use the filter to add new headers with specific values to a request chain, and it can also replace (i.e. remove any existing headers with the configured name) headers.
Filter name: Add Header
Filter configuration: add-header.cfg.xml
Required headers: There are no required headers for this filter.
Required preceding filters: There are no required preceding filters.
Standard filter order: Place this filter before any filters that need to receive the added static header in the request.
To set up the Add Header filter, edit the add-header.cfg.xml file. Within the request or response elements, define one or more header element(s):
- Configure the name attribute to name of the header to be added. Name is required.
- If you want to remove the old header, configure the overwrite attribute to true. Overwrite is optional.
- If you want to assign quality to users, configure the quality attribute from 0 to 1.0. Quality is optional.
The header value is given by the value of the header element.
|<add-headers>||-||Required||Specifies the sub-elements and attributes to define your add-filter configuration.|
Section to configure headers that should be added to the request.
|Section to configure headers that should be added to the response.|
|<header>||-||Required||Defines the header to be added.|
|name||Required||The header name.|
If set to false, a new header will be added with the header name and value (constructive). Default value for this attribute is false.
If overwrite is set to true, any existing headers with the same name will be removed from the request/response before the new value is added (destructive).
Quality assigned to users found in the request headers. If no quality is set, Repose will default this value to 1.0. Possible values for quality are 0 to 1.0.
As a user, I want to add a static header to a set of requests/responses to satisfy client or origin service invariants, or to simplify integration with Repose.