Hi,
just looking for a feedback to know if I did right (i.e. adding a lua
script to be have a tool to tweak header, "hard coding" the SetCookie
this way, ...).
Thx in advance for your comments.
CJ
Le 25/05/2018 à 22:00, jaillet...@apache.org a écrit :
Author: jailletc36
Date: Fri May 25 20:00:04 2018
New Revision: 1832275
URL: http://svn.apache.org/viewvc?rev=1832275=rev
Log:
Add test for ProxyPassReverseCookieDomain and ProxyPassReverseCookiePath.
See PR 61560.
Corrently broken, but working on a fix :)
Modified:
httpd/test/framework/trunk/t/conf/extra.conf.in
httpd/test/framework/trunk/t/modules/proxy.t
Modified: httpd/test/framework/trunk/t/conf/extra.conf.in
URL:
http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/conf/extra.conf.in?rev=1832275=1832274=1832275=diff
==
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Fri May 25 20:00:04 2018
@@ -283,6 +283,8 @@
ProxyPass /reverse/notproxy/ !
ProxyPass /reverse/ http://@SERVERNAME@:@PORT@/
ProxyPassReverse /reverse/ http://@SERVERNAME@:@PORT@/
+ ProxyPassReverseCookieDomain local remote
+ ProxyPassReverseCookiePath /local /remote
= 2.4.7>
ProxyPass /uds/ unix:/tmp/test-ptf.sock|http:
Modified: httpd/test/framework/trunk/t/modules/proxy.t
URL:
http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/proxy.t?rev=1832275=1832274=1832275=diff
==
--- httpd/test/framework/trunk/t/modules/proxy.t (original)
+++ httpd/test/framework/trunk/t/modules/proxy.t Fri May 25 20:00:04 2018
@@ -7,7 +7,7 @@ use Apache::TestUtil;
use Apache::TestConfig ();
use Misc;
-my $num_tests = 23;
+my $num_tests = 23 + 4;
if (have_min_apache_version('2.4.7')) {
$num_tests += 2;
}
@@ -97,6 +97,23 @@ my $c = $r->content;
chomp $c;
ok t_cmp($c, "hello world", "ProxyPass not-proxied content OK");
+# Testing ProxyPassReverseCookieDomain and ProxyPassReverseCookiePath
+if (have_module('lua')) {
+# '/' is escaped as %2F
+# ';' is escaped as %3B
+# '=' is escaped as %3D
+$r =
GET("/reverse//modules/lua/setheaderfromparam.lua?HeaderName=Set-Cookie=fakedomain%3Dlocal%3Bdomain%3Dlocal");
+ok t_cmp($r->code, 200, "Lua executed");
+ok t_cmp($r->header("Set-Cookie"), "fakedomain=local;domain=remote",
"'Set-Cookie domain=' wrongly updated by the ProxyPassReverseCookieDomain, PR 61560");
+
+$r =
GET("/reverse//modules/lua/setheaderfromparam.lua?HeaderName=Set-Cookie=fakepath%3D%2Flocal%3Bpath%3D%2Flocal");
+ok t_cmp($r->code, 200, "Lua executed");
+ok t_cmp($r->header("Set-Cookie"), "fakepath=/local;path=/remote", "'Set-Cookie
path=' wrongly updated by the ProxyPassReverseCookiePath, PR 61560");
+}
+else {
+skip "skipping tests which need mod_lua" foreach (1..4);
+}
+
if (have_module('alias')) {
$r = GET("/reverse/perm");
ok t_cmp($r->code, 301, "reverse proxy of redirect");