You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/10/12 17:16:52 UTC

[1/2] git commit: TS-2269 regex_remap plugin does not deal with empty path's properly.

Updated Branches:
  refs/heads/master 6b0fe6708 -> 4c5fbfa06


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


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/98d06d2d
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/98d06d2d
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/98d06d2d

Branch: refs/heads/master
Commit: 98d06d2df771798954801ea53ee3148ff0f1f631
Parents: 6b0fe67
Author: Kit Chan <chanshukit at gmail dot com>
Authored: Sat Oct 12 09:15:13 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sat Oct 12 09:15:13 2013 -0600

----------------------------------------------------------------------
 plugins/regex_remap/regex_remap.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/98d06d2d/plugins/regex_remap/regex_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/regex_remap/regex_remap.cc b/plugins/regex_remap/regex_remap.cc
index 63778d7..496fd30 100644
--- a/plugins/regex_remap/regex_remap.cc
+++ b/plugins/regex_remap/regex_remap.cc
@@ -800,9 +800,10 @@ TSRemapDoRemap(void* ih, TSHttpTxn txnp, TSRemapRequestInfo *rri)
   }
 
   *(match_buf + match_len) = '/';
+  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);
+    memcpy(match_buf + match_len, req_url.path, req_url.path_len);
+    match_len += (req_url.path_len);
   }
 
   if (ri->matrix_params && req_url.matrix && req_url.matrix_len > 0) {


[2/2] git commit: Added TS-2269.

Posted by zw...@apache.org.
Added TS-2269.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4c5fbfa0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4c5fbfa0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4c5fbfa0

Branch: refs/heads/master
Commit: 4c5fbfa06830ce9167a9be4a1992de22ba753c5e
Parents: 98d06d2
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sat Oct 12 09:16:41 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sat Oct 12 09:16:41 2013 -0600

----------------------------------------------------------------------
 CHANGES | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4c5fbfa0/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index d054929..c5c5007 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
+  *) [TS-2269] regex_remap plugin does not deal with empty path's properly.
+   Author: Kit Chan.
+
   *) [TS-2270] ESI Plugin can have infinite loop while doing gunzip on
    responses. Author: Kit Chan.