Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
454 stars 602 forks source link

StaticReferenceRewriteTransformerFactory adds a duplicate host scheme to url if a specific scheme is configured in OSGi config #3438

Closed senn closed 1 month ago

senn commented 1 month ago

Required Information

Expected Behavior

When rewriting url's using the StaticReferenceRewriteTransformerFactory, I expect correct url's, also when we configure a specific host scheme

Actual Behavior

When we configure a host scheme in OSGi, the rewriter (for our Campaign mails) adds a duplicate scheme to the url, resulting url's like https:https://wcmassets-f.mycompany.com/content/dam/my-image.jpeg

Steps to Reproduce (not verified)

  1. Install AAC 6.6.4
  2. Create a StaticReferenceRewriteTransformerFactory config and specify a host scheme (https), and set replacehOst to true
  3. generate content that is being rewritten and see the https:https

Links

Offending code snippet

senn commented 1 month ago

I'll try to create a PR for it

senn commented 1 month ago

It's very easily testable by adding the following line to the unit tests:

image