summaryrefslogtreecommitdiff
path: root/tests/mod-userdir.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mod-userdir.t')
-rwxr-xr-xtests/mod-userdir.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/mod-userdir.t b/tests/mod-userdir.t
index 40f55ef..52f9c32 100755
--- a/tests/mod-userdir.t
+++ b/tests/mod-userdir.t
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
-use Test::More tests => 5;
+use Test::More tests => 7;
use LightyTest;
my $tf = LightyTest->new();
@@ -26,6 +26,13 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
ok($tf->handle_http($t) == 0, 'valid user');
$t->{REQUEST} = ( <<EOF
+GET /%7Efoobar/ HTTP/1.0
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
+ok($tf->handle_http($t) == 0, 'valid user with url-encoded ~ as %7E');
+
+$t->{REQUEST} = ( <<EOF
GET /~jan HTTP/1.0
EOF
);
@@ -33,6 +40,13 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Locat
ok($tf->handle_http($t) == 0, 'valid user + redirect');
$t->{REQUEST} = ( <<EOF
+GET /%7Ejan HTTP/1.0
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://'.$tf->{HOSTNAME}.':'.$tf->{PORT}.'/~jan/' } ];
+ok($tf->handle_http($t) == 0, 'valid user with url encoded ~ as %7E + redirect');
+
+$t->{REQUEST} = ( <<EOF
GET /~jan HTTP/1.0
Host: www.example.org
EOF