3 Replies Latest reply on Oct 10, 2018 10:51 AM by ignacio.mancilla

    Linkchecker removing href value

    Radha Krishna.N Level 1

      Hi All,


      AEM version 6.1 SP1


      I am trying to author a link url - https://www.xyz.com/abc.jsp?filters={%22key%22:[%22value%22]} but linkchecker is removing this and logging a warning message in error log file

      23.10.2017 21:30:28.665 *WARN* [0:0:0:0:0:0:0:1 [1508808628533] GET /content/repl.template.html HTTP/1.1] com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl Ignoring malformed URI: java.net.URISyntaxException: Illegal character in query at index 73: https://www.xyz.com/abc.jsp?filters={%22key%22:[%22value%22]}

      23.10.2017 21:30:28.665 *WARN* [0:0:0:0:0:0:0:1 [1508808628533] GET /content/repl.template.html HTTP/1.1] org.apache.sling.xss.impl.HtmlToHtmlContentContext AntiSamy warning: The a tag contained an attribute that we could not process. The href attribute had a value of "https://www.xyz.com/abc.jsp?filters={%22key%22:[%22value%22]}". This value could not be accepted for security reasons. We have chosen to remove this attribute from the tag and leave everything else in place so that we could process the input.


      Also I tried validating the url as below


      // throws URI Syntax Exception: Linkchecker uses Java.net.URI
      URI uri = new URI("https://www.xyz.com/abc.jsp?filters={%22key%22:[%22value%22]}");
      //Works fine!! - org.apache.commons.validator.routines.UrlValidator
      UrlValidator urlValidator = new UrlValidator();


      how to resolve this issue on both author and publish instances?



      Radha Krishna N