You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Christopher Jackson (JIRA)" <ji...@apache.org> on 2015/11/12 18:57:10 UTC

[jira] [Created] (KNOX-623) Gateway provider rewriter doesn't support boolean attributes in HTML.

Christopher Jackson created KNOX-623:
----------------------------------------

             Summary: 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)