Add rewrite content rules, which modify text in HTTP response bodies as it is served to the client in PingAccess.
A rewrite content rule uses a subset of the Java regular expression syntax that
excludes look-behind constructs, such as
\b, and the boundary
\G. If no Java regular expression syntax is used, the rule
performs a case-sensitive search and replace. The most common use case for this rule
Extensive use of rewrite content rules might have significant performance implications.
This rule supports content that is either chunked or streamed from the target server. When sent to the client, the content is always chunked.
- Click Access and then go to .
- Click + Add Rule.
In the Name field, enter a unique name up to 64
Special characters and spaces are allowed.
- From the Type list, select Rewrite Content.
To define what type of response data to which the rewrite rule applies, enter
one or more Response Content-Types.
The default values are
application/json. The list is an ordered list.Info:
Only text-based content types are supported. Text-based content types compressed with gzip, deflate, or compress will decompress prior to rewrite rule processing, however, the content is not re-compressed before sending to the client.
Define one or more sets of Find and Replace Criteria.
If multiple criteria are specified, each operation is performed against the original content, effectively applying the rule concurrently.Important:
- If the protected application does not return a Content-Type header, select Missing Content-Type Allowed.
If you enable Missing Content-Type
Allowed, specify the encoding the application returns in the
Missing Content-Type Charset field.
This field could contain
UTF-8. A list of valid values is available in the Oracle Java 8 SE Technical Note.
If necessary, increase the size of the buffer used to
perform the replace operation by clicking Show Advanced
and entering a value in Maximum Buffer Size.
Replacement values cannot be larger than the buffer size. The minimum buffer size you can specify is 1024 bytes. There is no maximum value.
- Click Save.