Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2973

[PATCH] Cannot use custom schemes starting with "data" in resource resolving

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.5
    • 2.7
    • None
    • None

    Description

      In org.apache.fop.apps.io.InternalResourceResolver there is the following code:

          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));
          }
      

      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:

        public Resource getResource(String stringUri) throws IOException, URISyntaxException {
              if (stringUri.startsWith("data:")) {
                  return new Resource(resolveDataURI(stringUri));
              }
              return getResource(cleanURI(stringUri));
          }
      

      Attachments

        1. patch-FOP-2973-3.diff
          4 kB
          J Frank

        Activity

          People

            jagruti.frank@gmail.com J Frank
            erikhofer Erik Hofer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: