Mercurial > hg > nginx-tests
changeset 1536:0ce1c9516764
Tests: dav.t MKCOL test for trailing slash in Location (if any).
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 23 Dec 2019 19:38:49 +0300 |
parents | 144c6ce732e4 |
children | beb549bce15f |
files | dav.t |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/dav.t Mon Dec 02 14:56:37 2019 +0300 +++ b/dav.t Mon Dec 23 19:38:49 2019 +0300 @@ -21,7 +21,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http dav/)->plan(20); +my $t = Test::Nginx->new()->has(qw/http dav/)->plan(21); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -39,6 +39,8 @@ listen 127.0.0.1:8080; server_name localhost; + absolute_redirect off; + location / { dav_methods PUT DELETE MKCOL COPY MOVE; } @@ -117,6 +119,13 @@ like($r, qr/201 Created.*(Content-Length|\x0d\0a0\x0d\x0a)/ms, 'mkcol'); +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.17.7'); + +like($r, qr!(?(?{ $r =~ /Location/ })Location: /test/)!, 'mkcol location'); + +} + $r = http(<<EOF); COPY /test/ HTTP/1.1 Host: localhost @@ -170,7 +179,7 @@ EOF like($r, qr/201 Created.*(Content-Length|\x0d\0a0\x0d\x0a)/ms, 'put alias'); -like($r, qr!Location: http://localhost:\d+/i/alias\x0d?$!ms, 'location alias'); +like($r, qr!Location: /i/alias\x0d?$!ms, 'location alias'); is(-s $t->testdir() . '/alias', 10, 'put alias size'); ###############################################################################