[
https://issues.apache.org/jira/browse/TS-2269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13793366#comment-13793366
]
ASF subversion and git services commented on TS-2269:
-----------------------------------------------------
Commit 98d06d2df771798954801ea53ee3148ff0f1f631 in branch refs/heads/master
from [~kichan]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=98d06d2 ]
TS-2269 regex_remap plugin does not deal with empty path's properly.
This is a problem when the request URL path is just '/', which inside
of ATS is an emptry string.
Review: leif
> regex_remap plugin has problem handling the case when url path is empty
> -----------------------------------------------------------------------
>
> Key: TS-2269
> URL: https://issues.apache.org/jira/browse/TS-2269
> Project: Traffic Server
> Issue Type: Bug
> Components: Plugins
> Reporter: Kit Chan
> Assignee: Leif Hedstrom
> Fix For: 4.1.0
>
> Attachments: regex_remap.diff
>
>
> Specifically the block of code is here -
> https://github.com/apache/trafficserver/blob/master/plugins/regex_remap/regex_remap.cc#L802-806
> *(match_buf + match_len) = '/';
> if (req_url.path && req_url.path_len > 0) {
> memcpy(match_buf + match_len + 1, req_url.path, req_url.path_len);
> match_len += (req_url.path_len + 1);
> }
> So if req_url.path is empty (e.g. in the case of http://www.xyx.com/ being
> the request url), match_len will not increment by 1.
> so e.g. there won't be a match for this case for the regular expression of
> '^/$'
--
This message was sent by Atlassian JIRA
(v6.1#6144)