You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Kit Chan (JIRA)" <ji...@apache.org> on 2013/10/10 08:58:48 UTC
[jira] [Updated] (TS-2269) regex_remap plugin has problem handling
the case when url path is empty
[ https://issues.apache.org/jira/browse/TS-2269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kit Chan updated TS-2269:
-------------------------
Attachment: regex_remap.diff
Here is a simple patch
> 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
> 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)