The Split Header Filter splits header lines with multiple values into multiple header lines each with a single value.

Header values are split using the comma character (,) as a delimiter.

This filter can process both requests and responses.

This filter does not distinguish between headers that should and should not be split. Any header configured to be split will be split. Care should to taken to ensure that headers that should not be split (e.g., User-Agent) are not configured to be split. Please refer to RFC7231 for details on standard HTTP headers and their syntax.

General filter information

  • Name: split-header

  • Default Configuration: split-header.cfg.xml

  • Released: v8.9.1.0

  • Bundle: repose-filter-bundle

  • Schema

Prerequisites & Postconditions

Required Request Headers

This filter does not require any request headers.

Required Preceding Filters

This filter has no dependency on any other filter.

Request Headers Created

Changes to request headers vary based on configuration.

Existing request headers may be split across multiple lines.

Request Body Changes

This filter does not modify the request body.

This filter has no recommended follow-on filters.

Response Body Changes

This filter does not modify the response body.

Response Headers Created

Changes to response headers vary based on configuration.

Existing response headers may be split across multiple lines.

Response Status Codes

This filter does not modify the response code.

Examples

Exhaustive

This configuration will split the Accept and X-Roles headers on the request, and the Cache-Control header on the response.

For example, if a request is made with the header lines:

Accept: application/json, application/xml
Accept: text/plain

This filter will split those header lines into the header lines:

Accept: application/json
Accept: application/xml
Accept: text/plain
split-header.cfg.xml
<split-header xmlns='http://docs.openrepose.org/repose/split-header/v1.0'>
    <request> (1)
        <header>accept</header> (2)
        <header>x-roles</header> (3)
    </request>
    <response> (4)
        <header>cache-control</header> (5)
    </response>
</split-header>
1 A container for all of the request headers that should be split by this filter.
2 A header to be split by this filter. In this case, the standard HTTP Accept header will be split on requests.
3 A header to be split by this filter. In this case, the Repose-specific X-Roles header will be split on requests.
4 A container for all of the response headers that should be split by this filter.
5 A header to be split by this filter. In this case, the standard HTTP Cache-Control header will be split on responses.

Additional Information

Legacy

This filter may be used to imitate the the behavior of Repose when header splitting was performed as a core function rather than by this filter (prior to Repose v9). To configure this filter for that use case, see the Repose < 9.0 Header Splitting Behavior recipe.