The URL Extractor to Header filter can extract a portion of the request URL and put it in a header in the request.
Filter name: url-extractor-to-header
Filter configuration: url-extractor-to-header.cfg.xml
Preceding filters: None
- To enable this filter, add it to the system model.
<filter name="url-extractor-to-header"/> to the list of filters in system-model.cfg.xml
- Create a url-extractor-to-header.cfg.xml file in /etc/repose with the desired 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.
|<url-extractor-to-header>||-||Required||Specifies the sub-elements and attributes to define your filter configuration.|
|<extraction>||-||Required||Element to configure a URL extraction to a header.|
|header||Required||The name of the header to create.|
|url-regex||Required||The regular expression to apply to the URL to get the header value.|
|default||Optional||If 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.
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.