Tests: auth_basic_user_file variable tests with conf_prefix.
diff --git a/auth_basic.t b/auth_basic.t
index 32f3b9e..e8957ed 100644
--- a/auth_basic.t
+++ b/auth_basic.t
@@ -23,7 +23,7 @@
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http auth_basic/)->plan(21)
+my $t = Test::Nginx->new()->has(qw/http auth_basic/)->plan(24)
->write_file_expand('nginx.conf', <<'EOF');
%%TEST_GLOBALS%%
@@ -48,6 +48,12 @@
auth_basic off;
alias %%TESTDIR%%/;
}
+
+ location /var {
+ # prepended with conf_prefix
+ auth_basic_user_file $arg_f;
+ alias %%TESTDIR%%/;
+ }
}
}
}
@@ -112,6 +118,13 @@
like(http_get_auth('/', 'notfound', '1'), qr!401 Unauthorized!, 'not found');
like(http_get('/inner/'), qr!SEETHIS!, 'inner off');
+like(http_get_auth('/var/?f=htpasswd', 'apr1', 'password'), qr!SEETHIS!,
+ 'user file variable');
+unlike(http_get_auth('/var/?f=nx', 'apr1', 'password'), qr!SEETHIS!,
+ 'user file variable not found');
+unlike(http_get_auth('/var/', 'apr1', 'password'), qr!SEETHIS!,
+ 'user file variable bad value');
+
###############################################################################
sub http_get_auth {