URL Extractor to Header

Purpose

The URL Extractor to Header filter can extract a portion of the request URL and put it in a header in the request.

General filter information

Filter name: url-extractor-to-header

Filter configuration: url-extractor-to-header.cfg.xml

Release: 7.3.0.0

Prerequisites

Headers: None

Preceding filters: None

Basic configuration

  1. To enable this filter, add it to the system model.
    1. Add <filter name="url-extractor-to-header"/> to the list of filters in system-model.cfg.xml
  2. Create a url-extractor-to-header.cfg.xml file in /etc/repose with the desired configuration.

 

Configurable parameters

XML schema definition

Example configuration

 

The url-extractor-to-header.cfg.xml file contains the following elements and attributes. Add the filter to your Repose deployment through the system model configuration.

ElementsAttributes

Required/

Optional

Description
<url-extractor-to-header>-RequiredSpecifies the sub-elements and attributes to define your filter configuration.
<extraction>-RequiredElement to configure a URL extraction to a header.
headerRequiredThe name of the header to create.
url-regexRequiredThe regular expression to apply to the URL to get the header value.
defaultOptionalIf this attribute is not present and the URL doesn't match the url-regex, the header will not be created.
If this attribute is present and the URL doesn't match the url-regex, the header will be created using the value of this attribute.
If the URL does match the url-regex, this value is not used.

Return codes and conditions

This filter does not impact the response and should not cause an abrupt end of processing.

Request headers created

This filter will create the configured headers except in the case where the url-regex does not match the request URL and a default value is not specified.