The behavior sounds a bit strange, especially since you are reporting that everything works as expected on lower environments. It's a bit hard to give detailed advice with the amount of information provided.
My general advice in this kind of scenario is:
- Determine which component in the request stack is removing the substring in question.
- Does this happen on author and publish?
- Does this happen when accessing the instance directly vs. going through dispatcher, load balancer or other components involved?
- What URL are you seeing in the request and access logs for the incoming requests?
- Is the substring still present or has it been removed somewhere before even hitting AEM (maybe through rewriting/redirection in the webserver, a WAF or some other component)?
- What is the full request URL in the class that is handling these requests and tries to extract the selectors? Is the substring still present?
- Check the filter chain of the incoming request to see if something could potentially manipulate the URL and/or selectors.
Another approach would be to search for differences between your production setup (where the issue occurs) and a lower environment (where everything works as expected). It's always recommended to have some kind of pre-prod or staging environment that is very similar (if not equal) to the production setup to minimize differences and allow for easier issue reproduction and analysis.
Potential candidates causing the outlined issue that I could think of:
- URL rewriting on webserver level (cutting out the substring)
- Some kind of WAF that assumes the "amp" is malicious because it may reflect a HTML encoded ampersand ("&") and therefore filters it
- Some filter within AEM that manipulates the URL and/or certain selectors
Hope that helps!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.