Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceResolverMapTransformer should decode URI-encoded attribute values #1464

Closed
jsedding opened this issue Aug 23, 2018 · 0 comments
Closed
Labels
Milestone

Comments

@jsedding
Copy link
Contributor

Required Information

  • AEM 6.3 (any SP or CFP)
  • ACS AEM Commons 3.17.0 / Latest
  • ResourceResolverMapTransformerFactory configured to rewrite img:src

Expected Behavior

On author the assets UI should display images.

Actual Behavior

On author the assets UI displays no images, neither on tiles/cards or in the asset-detail view of an individual image.

Steps to Reproduce

  • Set up ResourceResolverMapTransformerFactory to rewrite img:src on an AEM 6.3 author.
  • Navigate to /assets.html into a folder containing images.

Analysis

The code rendering the assets UI calls org.apache.jackrabbit.util.Text#escapePath on the thumbnail URI (actually the web rendition in this case).

Hence the ResourceResolverMapTransformer gets an encoded path, more specifically with the "jcr:content" part encoded as "jcr%3acontent". Calling ResourceResolver#map on this doesn't achieve anything, as the path cannot be found in the repository. So no namespace mangling or other mappings are applied.

For some reason, I'm not quite sure if that's the rewriter pipeline, the URI-encoded "jcr:content" ends up rendered double-encoded, i.e. "jcr%253acontent", leading to a 404 when the browser loads the image.

I suggest to URI-decode the attribute value before passing it to ResourceResolver#map in ResourceResolverMapTransformerFactory.java#L95.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants