Skip to content

Commit 92b13c5

Browse files
authored
Merge pull request #65 from virtualmin/dev/fix-redirects-with-break
Fix to correctly handle redirects with break
2 parents c49273a + e289101 commit 92b13c5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

virtual_feature.pl

+5-3
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,8 @@ sub feature_list_web_redirects
17711771
}
17721772
my $m = $r->{'words'}->[2];
17731773
$redirect->{'code'} = $m eq 'permanent' ? 301 :
1774-
$m eq 'redirect' ? 302 : undef;
1774+
$m eq 'redirect' ? 302 :
1775+
$m eq 'break' ? 302 : undef;
17751776
}
17761777
elsif ($r->{'words'}->[0] =~ /\^\/\(\?\!\.well\-known\)(\$)?/) {
17771778
# Special case for / which excludes .well-known
@@ -1793,8 +1794,9 @@ sub feature_list_web_redirects
17931794
$redirect->{'dest'}, 0);
17941795
$redirect->{'alias'} = 0;
17951796
}
1796-
elsif ($r->{'words'}->[2] eq 'redirect' ||
1797-
$r->{'words'}->[2] eq 'permanent') {
1797+
elsif ($r->{'words'}->[2] eq 'permanent' ||
1798+
$r->{'words'}->[2] eq 'redirect' ||
1799+
$r->{'words'}->[2] eq 'break') {
17981800
# Redirect to a URL path, which is taken as relative
17991801
# to the original URL
18001802
$redirect->{'alias'} = 0;

0 commit comments

Comments
 (0)