summaryrefslogtreecommitdiff
path: root/tests/core-response.t
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2015-11-07 15:00:18 +0000
committerStefan Bühler <stbuehler@web.de>2015-11-07 15:00:18 +0000
commit85d8a17575d8eba2f830f6c15283a45773fa78d8 (patch)
treea0f17e9220f4ce69e214f68b32bbadb65fbca7b1 /tests/core-response.t
parent3943de280e9966e064ae704e0e11aff155e875a9 (diff)
downloadlighttpd1.4-85d8a17575d8eba2f830f6c15283a45773fa78d8.tar.gz
lighttpd1.4-85d8a17575d8eba2f830f6c15283a45773fa78d8.zip
[core] encode path with ENCODING_REL_URI in redirect to directory (fixes #2661, thx gstrauss)
From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3052 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/core-response.t')
-rwxr-xr-xtests/core-response.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/core-response.t b/tests/core-response.t
index ff2cf1d2..5cd784c4 100755
--- a/tests/core-response.t
+++ b/tests/core-response.t
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
-use Test::More tests => 12;
+use Test::More tests => 14;
use LightyTest;
my $tf = LightyTest->new();
@@ -86,6 +86,20 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://'.$tf->{HOSTNAME}.':'.$tf->{PORT}.'/dummydir/?foo' } ];
ok($tf->handle_http($t) == 0, 'internal redirect in directory + querystring');
+$t->{REQUEST} = ( <<EOF
+GET /~test%20ä_ HTTP/1.0
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://'.$tf->{HOSTNAME}.':'.$tf->{PORT}.'/~test%20%c3%a4_/' } ];
+ok($tf->handle_http($t) == 0, 'internal redirect in directory with special characters');
+
+$t->{REQUEST} = ( <<EOF
+GET /~test%20ä_?foo HTTP/1.0
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://'.$tf->{HOSTNAME}.':'.$tf->{PORT}.'/~test%20%c3%a4_/?foo' } ];
+ok($tf->handle_http($t) == 0, 'internal redirect in directory with special characters + querystring');
+
## simple-vhost
$t->{REQUEST} = ( <<EOF