comparison 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
comparison
equal deleted inserted replaced
1690:29f0e926c15f 1691:0d8531f744bc
19 ############################################################################### 19 ###############################################################################
20 20
21 select STDERR; $| = 1; 21 select STDERR; $| = 1;
22 select STDOUT; $| = 1; 22 select STDOUT; $| = 1;
23 23
24 my $t = Test::Nginx->new()->has(qw/http dav/)->plan(27); 24 my $t = Test::Nginx->new()->has(qw/http dav/)->plan(28);
25 25
26 $t->write_file_expand('nginx.conf', <<'EOF'); 26 $t->write_file_expand('nginx.conf', <<'EOF');
27 27
28 %%TEST_GLOBALS%% 28 %%TEST_GLOBALS%%
29 29
106 like($r, qr/201 Created.*(Content-Length|\x0d\0a0\x0d\x0a)/ms, 106 like($r, qr/201 Created.*(Content-Length|\x0d\0a0\x0d\x0a)/ms,
107 'put file extra data'); 107 'put file extra data');
108 is(-s $t->testdir() . '/file', 10, 108 is(-s $t->testdir() . '/file', 10,
109 'put file extra data size'); 109 'put file extra data size');
110 110
111 TODO: {
112 local $TODO = 'not yet' unless $t->has_version('1.21.0');
113
114 $r = http(<<EOF . '0123456789');
115 PUT /file%20sp HTTP/1.1
116 Host: localhost
117 Connection: close
118 Content-Length: 10
119
120 EOF
121
122 like($r, qr!Location: /file%20sp\x0d?$!ms, 'put file escaped');
123
124 }
125
111 # 201 replies contain body, response should indicate it's empty 126 # 201 replies contain body, response should indicate it's empty
112 127
113 $r = http(<<EOF); 128 $r = http(<<EOF);
114 MKCOL /test/ HTTP/1.1 129 MKCOL /test/ HTTP/1.1
115 Host: localhost 130 Host: localhost