From 2eeb62e38ae17a3523ad3cd81c3de9f20f9e7742 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Sat, 25 May 2024 06:41:28 +0200
Subject: Adding debian version 2.4.59-1~deb10u1.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 debian/perl-framework/t/modules/proxy.t | 47 +++++++++++++++++++++++++++++++--
 1 file changed, 45 insertions(+), 2 deletions(-)

(limited to 'debian/perl-framework/t/modules/proxy.t')

diff --git a/debian/perl-framework/t/modules/proxy.t b/debian/perl-framework/t/modules/proxy.t
index af822cd..0a81f4f 100644
--- a/debian/perl-framework/t/modules/proxy.t
+++ b/debian/perl-framework/t/modules/proxy.t
@@ -7,16 +7,45 @@ use Apache::TestUtil;
 use Apache::TestConfig ();
 use Misc;
 
-my $num_tests = 31;
+my $num_tests = 46;
 plan tests => $num_tests, need need_module 'proxy', need_module 'setenvif';
 
 Apache::TestRequest::module("proxy_http_reverse");
 Apache::TestRequest::user_agent(requests_redirectable => 0);
 
 my $r = GET("/reverse/");
-ok t_cmp($r->code, 200, "reverse proxy to index.html");
+ok t_cmp($r->code, 200, "reverse proxy");
 ok t_cmp($r->content, qr/^welcome to /, "reverse proxied body");
 
+$r = GET("/reverse/index.html");
+ok t_cmp($r->code, 200, "reverse proxy to index.html");
+ok t_cmp($r->content, qr/^welcome to /, "reverse proxied body to index.html");
+
+if (have_min_apache_version('2.4.49')) {
+    $r = GET("/reverse-match/");
+    ok t_cmp($r->code, 200, "reverse proxy match");
+    ok t_cmp($r->content, qr/^welcome to /, "reverse proxied body match");
+
+    $r = GET("/reverse-match/index.html");
+    ok t_cmp($r->code, 200, "reverse proxy match to index.html");
+    ok t_cmp($r->content, qr/^welcome to /, "reverse proxied body match to index.html");
+}
+else { 
+    skip "skipping reverse-match test with httpd <2.5.1" foreach (1..4);
+}
+
+$r = GET("/reverse-slash");
+ok t_cmp($r->code, 200, "reverse proxy match no slash");
+ok t_cmp($r->content, qr/^welcome to /, "reverse proxied body no slash");
+
+$r = GET("/reverse-slash/");
+ok t_cmp($r->code, 200, "reverse proxy match w/ slash");
+ok t_cmp($r->content, qr/^welcome to /, "reverse proxied body w/ slash");
+
+$r = GET("/reverse-slash/index.html");
+ok t_cmp($r->code, 200, "reverse proxy match w/ slash to index.html");
+ok t_cmp($r->content, qr/^welcome to /, "reverse proxied body w/ slash to index.html");
+
 if (have_min_apache_version('2.4.0')) {
     $r = GET("/reverse/locproxy/");
     ok t_cmp($r->code, 200, "reverse Location-proxy to index.html");
@@ -188,3 +217,17 @@ else {
     skip "skipping UDS tests with httpd < 2.4.7" foreach (1..2);
 }
 
+if (have_min_apache_version('2.4.49')) {
+
+    $r = GET("/notexisting/../mapping/mapping.html");
+    ok t_cmp($r->code, 200, "proxy mapping=servlet map it to /servlet/mapping.html");
+    
+    $r = GET("/notexisting/..;/mapping/mapping.html");
+    ok t_cmp($r->code, 200, "proxy mapping=servlet map it to /servlet/mapping.html");
+
+    $r = GET("/mapping/mapping.html");
+    ok t_cmp($r->code, 200, "proxy to /servlet/mapping.html");
+}
+else {
+    skip "skipping tests with mapping=servlet" foreach (1..3);
+}
-- 
cgit v1.2.3