Content Injection
policies/content_injection[]
The gateway can inject content into responses. This entry defines the content and when injection should take place. Content injection is performed based on the request path and a specific location within the response.
This entry is an array and can define multiple content injection points.
Properties
Name | Type | Constraints | Description |
---|---|---|---|
name | string | A name to be associated with this content injection rule. | |
paths | Array of string | The path for which content injection will take place. This entry is an array and can be used to specify multiple paths. | |
full_line_match | boolean | Values: true or false Default value: true | Should the location match a full line, or should it match any string in the response? When a full line match is configured the content will be inserted prior to the matching line. When a partial line match is configured the content will be inserted immediately prior to the matching string. |
location | string | The location where the content should be injected. If a full line match is being used the location is pattern matched against a line in the response using the *. wildcard characters. The maximum length of a line which can be matched is 8192 bytes. | |
replace_match | boolean | Values: true or false Default value: false | If a partial line match is being used this configuration entry will control whether the matching string is replaced with the supplied content, or whether the supplied content is inserted prior to the matching string. This configuration entry will be ignored if full line matches are being used. |
content | string | The data which is to be injected. |
Example
policies:
content_injection:
- name: content_injection_1
paths:
- "/test"
- "/test2"
location: "<h3>*"
content: |
<hr/>
<h4>Add heading4 after heading3</h4>
<hr/>
Updated over 2 years ago