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