[
https://issues.apache.org/jira/browse/TS-2269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13791255#comment-13791255
]
Kit Chan commented on TS-2269:
------------------------------
I have a patch available.
> 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
>
> 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)