Add Header Filter



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.

General filter information

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.

Basic add header configuration

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):

  1. Configure the name attribute to name of the header to be added. Name is required.
  2. If you want to remove the old header, configure the overwrite attribute to true. Overwrite is optional.
  3. 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.

Configurable parameters

XML schema definition

Example configuration




<add-headers>-RequiredSpecifies 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>-RequiredDefines the header to be added.
nameRequiredThe 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.

Concrete Config Example

<?xml version="1.0" encoding="UTF-8"?>

<add-headers xmlns="">
    <!-- This section is for headers to add in the request -->
        <!-- this config will not overwrite an existing value -->
        <header name="repose-test" quality="0.5" overwrite="false">this-is-a-test</header>
        <!-- This config will overwrite an existing header forcing it to be as specified -->
        <header name="overwrite-test" quality="0.5" overwrite="true">this-is-overwrite-value</header>

    <!-- this section is for headers to add in the response -->
        <!-- this config will overwrite a header -->
        <header name="response-header" quality="0.9" overwrite="true">foooo</header>


Use case

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.