You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "J Frank (Jira)" <ji...@apache.org> on 2021/09/14 09:31:00 UTC

[jira] [Updated] (FOP-2973) [Patch] Cannot use custom schemes starting with "data" in resource resolving

     [ https://issues.apache.org/jira/browse/FOP-2973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

J Frank updated FOP-2973:
-------------------------
    Summary: [Patch] Cannot use custom schemes starting with "data" in resource resolving  (was: Cannot use custom schemes starting with "data" in resource resolving)

> [Patch] Cannot use custom schemes starting with "data" in resource resolving
> ----------------------------------------------------------------------------
>
>                 Key: FOP-2973
>                 URL: https://issues.apache.org/jira/browse/FOP-2973
>             Project: FOP
>          Issue Type: Bug
>    Affects Versions: 2.5
>            Reporter: Erik Hofer
>            Priority: Minor
>         Attachments: patch-FOP-2973-3.diff
>
>
> In {{org.apache.fop.apps.io.InternalResourceResolver}} there is the following code:
> {code:java}
>     public Resource getResource(URI uri) throws IOException {
>         if (uri.getScheme() != null && uri.getScheme().startsWith("data")) {
>             return new Resource(resolveDataURI(uri.toASCIIString()));
>         }
>         return resourceResolver.getResource(resolveFromBase(uri));
>     }
> {code}
> All URIs with a scheme _starting with_ "data" are treated as a data URI. This means schemes like "dataFoo" are not delegated to the {{resourceResolver}}. I think this should be {{equals}} instead.
> The string overload works correctly because it includes the colon:
> {code:java}
>   public Resource getResource(String stringUri) throws IOException, URISyntaxException {
>         if (stringUri.startsWith("data:")) {
>             return new Resource(resolveDataURI(stringUri));
>         }
>         return getResource(cleanURI(stringUri));
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)