diff dav.t @ 1691:0d8531f744bc

Tests: added Location header escaping tests (ticket #882).
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 27 May 2021 13:07:46 +0300
parents b9de5364dfc9
children 5ac6efbe5552
line wrap: on
line diff
--- a/dav.t
+++ b/dav.t
@@ -21,7 +21,7 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http dav/)->plan(27);
+my $t = Test::Nginx->new()->has(qw/http dav/)->plan(28);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -108,6 +108,21 @@ like($r, qr/201 Created.*(Content-Length
 is(-s $t->testdir() . '/file', 10,
 	'put file extra data size');
 
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.21.0');
+
+$r = http(<<EOF . '0123456789');
+PUT /file%20sp HTTP/1.1
+Host: localhost
+Connection: close
+Content-Length: 10
+
+EOF
+
+like($r, qr!Location: /file%20sp\x0d?$!ms, 'put file escaped');
+
+}
+
 # 201 replies contain body, response should indicate it's empty
 
 $r = http(<<EOF);