[ 
https://issues.apache.org/jira/browse/KNOX-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15002668#comment-15002668
 ] 

Kevin Minder commented on KNOX-623:
-----------------------------------

@Christopher Jackson < Did you want to fix this or should I take care of it?

> Gateway provider rewriter doesn't support boolean attributes in HTML.
> ---------------------------------------------------------------------
>
>                 Key: KNOX-623
>                 URL: https://issues.apache.org/jira/browse/KNOX-623
>             Project: Apache Knox
>          Issue Type: Bug
>    Affects Versions: 0.6.0
>            Reporter: Christopher Jackson
>
> When enabling 'rewrite' on a service it fails to correctly parse HTML with 
> boolean attributes. 
> According to w3 it is valid for attributes to not have values, they are known 
> as boolean attributes (see link below). The current implementation of the 
> html filter rewriter fails to parse boolean attributes which results in those 
> attributes being assigned a value of null instead of remaining a boolean 
> attribute. 
> http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#boolean-attributes
> Here's an additional unit test for HtmlFilterReaderBaseTest that shows the 
> problem.
> {code}
> @Test
>       public void testBooleanAttribute() throws IOException, 
> ParserConfigurationException
>       {
>               String inputXml = "<html ng-app=\"angularapp\" 
> ng-controller=\"AppCtrl\" role=\"application\" aria-labelledBy=\"title\">\n" 
> + "<head>\n"
>                               + "<title id=\"title\" 
> ng-bind=\"pageTitle\"></title>\n" + "</head>\n" + "<body>\n" + "<div 
> class=\"container\">\n" + "<div ui-view></div>\n"
>                               + "</div>\n" + "</body>\n" + "</html>\n";
>               StringReader inputReader = new StringReader(inputXml);
>               HtmlFilterReaderBase filterReader = new 
> NoopXmlFilterReader(inputReader);
>               String outputHtml = new 
> String(IOUtils.toCharArray(filterReader));
>               assertEquals(inputXml, outputHtml);
>       }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to