Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7476

Exceptions should be logged correctly

    XMLWordPrintableJSON

    Details

      Description

      when filtering a source that is larger than 200k, the xss api fails with:

      java.lang.RuntimeException: Unable to scan input
      
      	at org.apache.sling.xss.impl.HtmlToHtmlContentContext.filter(HtmlToHtmlContentContext.java:73)
      	at org.apache.sling.xss.impl.XSSFilterImpl.filter(XSSFilterImpl.java:190)
      	at org.apache.sling.xss.impl.XSSFilterImpl.filter(XSSFilterImpl.java:123)
      	at org.apache.sling.xss.impl.XSSAPIImpl.filterHTML(XSSAPIImpl.java:466)
      	at org.apache.sling.xss.impl.XSSAPIImplTest.testFilterLargeHTML(XSSAPIImplTest.java:223)
      

      Test:

          @Test
          public void testFilterLargeHTML() {
              final int SIZE = 210000;
              StringBuilder b = new StringBuilder(SIZE);
              while (b.length() < SIZE) {
                  b.append("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec at enim et dui egestas accumsan amet.");
              }
              String source = b.toString();
              TestCase.assertEquals("Filtering large source", source, xssAPI.filterHTML(source));
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                radu Radu Cotescu
                Reporter:
                tripod Tobias Bocanegra
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: