Force strict if URL matching regex. #624
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a list of regular expressions that URLs being processed by the ConfigurableExtractorJS are evaluated against. If they match the extraction is performed in strict mode, even if strict mode is not set.
This requires a minor modification to ExtractorJS so that the CrawlURI is passed to the shouldAddUri method that ConfigurableExtractorJS overrides.
This PR was motivated by common Wordpress JSON files like: https://frettatiminn.is/wp-json/wp/v2/media/52942
They contain many absolute URLs, so excluding them may well cause missed content, but they also list filename etc. that can not be resolved relative to the JSON file itself and should just be ignored.
Adding a regex of
^.*/wp-json/.*$
to the new setting will address this.It may also be of value to be able to apply this rule based on content-type.