ExtensionReferenceFilter
Filter by file extension (if present on last segment).
Notes
Filters references by the file extension found in the last path segment of the URL or file path. Accepts or rejects references based on whether their extension matches the configured list.
Examples
The following example will only accept references with the following extensions, regardless of character case: .html, .htm, .php, and .asp.
- YAML
- JSON
- XML
class: ExtensionReferenceFilter
extensions:
- html
- htm
- php
- asp
ignoreCase: true
{
"class": "ExtensionReferenceFilter",
"extensions": [
"html",
"htm",
"php",
"asp"
],
"ignoreCase": true
}
<class>ExtensionReferenceFilter</class>
<extensions>
<extension>html</extension>
<extension>htm</extension>
<extension>php</extension>
<extension>asp</extension>
</extensions>
<ignoreCase>true</ignoreCase>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: ExtensionReferenceFilter
extensions:
- string
ignoreCase: false
onMatch: INCLUDE
{
"class": "ExtensionReferenceFilter",
"extensions": [
"string"
],
"ignoreCase": false,
"onMatch": "INCLUDE"
}
<extensionReferenceFilter>
<class>ExtensionReferenceFilter</class>
<extensions>
<extension>string</extension>
</extensions>
<ignoreCase>false</ignoreCase>
<onMatch>INCLUDE</onMatch>
</extensionReferenceFilter>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
extensions | string[] | No | - |
ignoreCase | boolean | No | false |
onMatch | enum | No | INCLUDE |
Property Details
extensions
One or more file extension (e.g., html, pdf, ...).
ignoreCase
When enabled, matching is performed without regard to character case.
onMatch
What to do with a reference once its file extension is matched.
Allowed Values
INCLUDEEXCLUDE