GFI response handling improvements #133
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.
Continues the work done in PR #77.
Allows target attribute and data-urls for images in GFI responses by default (oskari.properties).
The allowed tags for HTML-sanitation can now be configured in oskari-ext.properties. Without any config the basic allowed tags are described in #77 as "Jsoup relaxed" setting. The configuration can be used to allow more tags/attributes/protocols, but NOT restrict it. For allowing more tags for the GFI-functionality you can use these properties:
All links will get target="_blank" automatically for GFI responses (if target attribute is allowed for links). All relative links/images are transformed to absolute urls in GFI (/something to https://base.url/something).
Added a generic HTML-sanitation class and a Jsoup whitelist implementation to allow data-urls in images. This can be used in other places, but currently is not:
The config prefix can be omitted. Properties without any prefix like "html.whitelist" are used in that case. For example the gfi functionality uses prefix "gfi" which results in properties like "gfi.html.whitelist". The call to modifyLinks can also be omitted.