Tests: secure_link inheritance test.
diff --git a/secure_link.t b/secure_link.t index 79630d6..4354a54 100644 --- a/secure_link.t +++ b/secure_link.t
@@ -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 {