[
https://issues.apache.org/jira/browse/TS-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13870535#comment-13870535
]
Yu Qing edited comment on TS-2488 at 1/14/14 8:57 AM:
------------------------------------------------------
hi, Kit Chan, the old codes are confusion.
{code}
42 const EsiParser::EsiNodeInfo EsiParser::ESI_NODES[] = {
43 EsiNodeInfo(DocNode::TYPE_INCLUDE, "include ", 8, "/>", 2),
44 EsiNodeInfo(DocNode::TYPE_REMOVE, "remove>", 7, "</esi:remove>", 13),
45 EsiNodeInfo(DocNode::TYPE_COMMENT, "comment ", 7, "/>", 2),
46 EsiNodeInfo(DocNode::TYPE_VARS, "vars>", 5, "</esi:vars>", 11),
47 EsiNodeInfo(DocNode::TYPE_CHOOSE, "choose>", 7, "</esi:choose>", 13),
48 EsiNodeInfo(DocNode::TYPE_WHEN, "when ", 5, "</esi:when>", 11),
49 EsiNodeInfo(DocNode::TYPE_OTHERWISE, "otherwise>", 10,
"</esi:otherwise>", 16),
50 EsiNodeInfo(DocNode::TYPE_TRY, "try>", 4, "</esi:try>", 10),
51 EsiNodeInfo(DocNode::TYPE_ATTEMPT, "attempt> ", 8, "</esi:attempt>", 14),
52 EsiNodeInfo(DocNode::TYPE_EXCEPT, "except> ", 7, "</esi:except>", 13),
53 EsiNodeInfo(DocNode::TYPE_SPECIAL_INCLUDE, "special-include ", 15, "/>",
2),
54 EsiNodeInfo(DocNode::TYPE_UNKNOWN, "", 0, "", 0) // serves as end marker
55 };
56
{code}
the length of "comment " is 8, not 7! and the length of "special-include " is
16, not 15! I think this is a bug, so i fixed it in this patch.
according to the the syntax of ESI or XML, one of space chars(' ', '\t', '\r',
'\n'), '/' and '>' must follow these starting tags. so the old codes make a
mistake.
any question?
was (Author: happy_fish100):
hi, Kit Chan, the old codes are confusion.
[code]
42 const EsiParser::EsiNodeInfo EsiParser::ESI_NODES[] = {
43 EsiNodeInfo(DocNode::TYPE_INCLUDE, "include ", 8, "/>", 2),
44 EsiNodeInfo(DocNode::TYPE_REMOVE, "remove>", 7, "</esi:remove>", 13),
45 EsiNodeInfo(DocNode::TYPE_COMMENT, "comment ", 7, "/>", 2),
46 EsiNodeInfo(DocNode::TYPE_VARS, "vars>", 5, "</esi:vars>", 11),
47 EsiNodeInfo(DocNode::TYPE_CHOOSE, "choose>", 7, "</esi:choose>", 13),
48 EsiNodeInfo(DocNode::TYPE_WHEN, "when ", 5, "</esi:when>", 11),
49 EsiNodeInfo(DocNode::TYPE_OTHERWISE, "otherwise>", 10,
"</esi:otherwise>", 16),
50 EsiNodeInfo(DocNode::TYPE_TRY, "try>", 4, "</esi:try>", 10),
51 EsiNodeInfo(DocNode::TYPE_ATTEMPT, "attempt> ", 8, "</esi:attempt>", 14),
52 EsiNodeInfo(DocNode::TYPE_EXCEPT, "except> ", 7, "</esi:except>", 13),
53 EsiNodeInfo(DocNode::TYPE_SPECIAL_INCLUDE, "special-include ", 15, "/>",
2),
54 EsiNodeInfo(DocNode::TYPE_UNKNOWN, "", 0, "", 0) // serves as end marker
55 };
56
[code]
the length of "comment " is 8, not 7! and the length of "special-include " is
16, not 15! I think this is a bug, so i fixed it in this patch.
according to the the syntax of ESI or XML, one of space chars(' ', '\t', '\r',
'\n'), '/' and '>' must follow these starting tags. so the old codes make a
mistake.
any questiion?
> any of the space chars can follow the esi starting tags
> -------------------------------------------------------
>
> Key: TS-2488
> URL: https://issues.apache.org/jira/browse/TS-2488
> Project: Traffic Server
> Issue Type: Improvement
> Components: Plugins
> Reporter: Yu Qing
> Assignee: Kit Chan
> Attachments:
> 0001-TS-2488-any-space-char-can-follow-the-esi-starting-t.patch, 2488.txt,
> bugfix-for-TS-2488.patch
>
>
> only the space char ' ' can follow the esi starting tags such as
> "<esi:include", "<!--esi" now, we should allow any space char after these
> tags. the space chars include: ' ', '\t', '\r' and '\n'.
> for example, following common usage:
> <!--esi
> esi bala bala ...
> -->
> because no space after the "<!--esi", the esi parser will keep these tags
> which should be removed.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)