Mercurial > hg > nginx-tests
changeset 256:85c3b87f2a80
Tests: merge.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 29 Jan 2013 21:34:11 +0400 |
parents | 0cc5269bc62c (current diff) cca7b57587d6 (diff) |
children | 2cb970dda24b |
files | |
diffstat | 1 files changed, 23 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/secure_link.t Tue Jan 29 21:31:16 2013 +0400 +++ b/secure_link.t Tue Jan 29 21:34:11 2013 +0400 @@ -24,7 +24,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http secure_link/)->plan(8); +my $t = Test::Nginx->new()->has(qw/http secure_link/)->plan(9); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -94,6 +94,21 @@ rewrite ^ /$secure_link break; } + + location /inheritance/ { + secure_link_secret secret; + + location = /inheritance/test { + secure_link Xr4ilOzQ4PCOq3aQ0qbuaQ==; + secure_link_md5 secret; + + if ($secure_link = "1") { + rewrite ^ /test.html break; + } + + return 403; + } + } } } @@ -135,6 +150,13 @@ 'request old style fake hash'); like(http_get('/p/test.html'), qr/^HTTP.*403/, 'request old style no hash'); +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.3.12'); + +like(http_get('/inheritance/test'), qr/PASSED/, 'inheritance'); + +} + ############################################################################### sub encode_base64url {