summaryrefslogtreecommitdiff
path: root/tests/mod-userdir.t
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2013-06-29 10:07:45 +0000
committerStefan Bühler <stbuehler@web.de>2013-06-29 10:07:45 +0000
commitf0a2c0f293056ef2327debc79807c4e115aeb4e9 (patch)
treeba8d85bcd17032e41000e08e762abddf1c29ce6e /tests/mod-userdir.t
parent12c4a40b28bdd8f00fecbd29ab01d24da3f17a16 (diff)
downloadlighttpd1.4-f0a2c0f293056ef2327debc79807c4e115aeb4e9.tar.gz
lighttpd1.4-f0a2c0f293056ef2327debc79807c4e115aeb4e9.zip
[mod_user] add test cases to check handling of encoded ~ as %7E (#2124)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2881 152afb58-edef-0310-8abb-c4023f1b3aa9
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 40f55efb..52f9c32f 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