comparison dav.t @ 367:0726521e42f3

Tests: added tests for escaped and unsafe URIs. This covers problems in DAV, SSI, X-Accel-Redirect fixed in 1.5.9.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 25 Dec 2013 12:03:40 +0400
parents 6a0d934950bc
children 847ea345becb
comparison
equal deleted inserted replaced
366:77c301be6c2d 367:0726521e42f3
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(13); 24 my $t = Test::Nginx->new()->has(qw/http dav/)->plan(15);
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
128 Destination: /test-moved/ 128 Destination: /test-moved/
129 Connection: close 129 Connection: close
130 130
131 EOF 131 EOF
132 132
133 like($r, qr/201.*(Content-Length|\x0d\0a0\x0d\x0a)/ms, 'move dir'); 133 like($r, qr/201 Created.*(Content-Length|\x0d\0a0\x0d\x0a)/ms, 'move dir');
134
135 $r = http(<<EOF);
136 COPY /file HTTP/1.1
137 Host: localhost
138 Destination: /file-moved%20escape
139 Connection: close
140
141 EOF
142
143 like($r, qr/204 No Content/, 'copy file escaped');
144
145 TODO: {
146 local $TODO = 'not yet' unless $t->has_version('1.5.9');
147
148 is(-s $t->testdir() . '/file-moved escape', 10, 'file copied unescaped');
149
150 }
134 151
135 ############################################################################### 152 ###############################################################################