summaryrefslogtreecommitdiffstats
path: root/debian/perl-framework/t/modules/alias.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-25 04:41:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-25 04:41:28 +0000
commit2eeb62e38ae17a3523ad3cd81c3de9f20f9e7742 (patch)
treefe91033d4712f6d836006b998525656b9dd193b8 /debian/perl-framework/t/modules/alias.t
parentMerging upstream version 2.4.59. (diff)
downloadapache2-2eeb62e38ae17a3523ad3cd81c3de9f20f9e7742.tar.xz
apache2-2eeb62e38ae17a3523ad3cd81c3de9f20f9e7742.zip
Adding debian version 2.4.59-1~deb10u1.debian/2.4.59-1_deb10u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/perl-framework/t/modules/alias.t')
-rw-r--r--debian/perl-framework/t/modules/alias.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/perl-framework/t/modules/alias.t b/debian/perl-framework/t/modules/alias.t
index a605966..957fccc 100644
--- a/debian/perl-framework/t/modules/alias.t
+++ b/debian/perl-framework/t/modules/alias.t
@@ -35,6 +35,14 @@ my %rm_rc = (
f => '403'
);
+
+my %relative_redirects = (
+ "/redirect_relative/default" => "^http", # URL should be absolute
+ "/redirect_relative/on" => "^/out-on", # URL should be relative
+ "/redirect_relative/off" => "^http", # URL should be absolute
+ "/redirect_relative/off/fail" => undef, # 500 due to invalid URL
+);
+
#XXX: find something that'll on other platforms (/bin/sh aint it)
my $script_tests = WINFU ? 0 : 4 + have_min_apache_version("2.4.19");
@@ -44,6 +52,10 @@ my $tests = 12 + have_min_apache_version("2.4.19") * 10 +
(keys %rm_rc) * (1 + have_min_apache_version("2.4.19")) * 10 +
$script_tests;
+if (have_min_apache_version("2.5.1")) {
+ $tests += (keys %relative_redirects)*2;
+}
+
#LWP required to follow redirects
plan tests => $tests, need need_module('alias'), need_lwp;
@@ -207,3 +219,22 @@ ok t_cmp((GET_RC "/aliascgi-nada"),
## clean up ##
t_rmtree("$vars->{t_logs}/mod_cgi.log");
+
+
+if (have_min_apache_version("2.5.1")) {
+ my ($path, $regex);
+ while (($path, $regex) = each (%relative_redirects)) {
+ local $Apache::TestRequest::RedirectOK = 0;
+ my $r;
+ $r = GET($path);
+ if (defined($regex)) {
+ ok t_cmp($r->code, "302");
+ ok t_cmp($r->header("Location"), qr/$regex/, "failure on $path");
+ }
+ else {
+ ok t_cmp($r->code, "500");
+ ok t_cmp($r->header("Location"), undef, "failure on $path");
+ }
+ }
+}
+