diff auth_request.t @ 1343:2ff483941037

Tests: added njs http internalRedirect() method tests.
author Dmitry Volyntsev <xeioex@nginx.com>
date Wed, 13 Jun 2018 14:53:43 +0300
parents 196d33c2bb45
children 856ab7671404
line wrap: on
line diff
--- a/auth_request.t
+++ b/auth_request.t
@@ -57,6 +57,15 @@ http {
             return 204;
         }
 
+        location /auth_file {
+            auth_request /file/t;
+        }
+
+		location /file/ {
+		    alias %%TESTDIR%%/;
+		}
+
+
         location /open-static {
             auth_request /auth-open-static;
         }
@@ -144,16 +153,19 @@ EOF
 $t->write_file('htpasswd', 'user:{PLAIN}secret' . "\n");
 $t->write_file('auth-basic', 'INVISIBLE');
 $t->write_file('auth-open-static', 'INVISIBLE');
+$t->write_file('t', '["SEE-THIS"]');
 $t->run();
 
 ###############################################################################
 
+like(http_get('/auth_file'), qr/ 200 /, 'auth file');
 like(http_get('/open'), qr/ 404 /, 'auth open');
 like(http_get('/unauthorized'), qr/ 401 /, 'auth unauthorized');
 like(http_get('/forbidden'), qr/ 403 /, 'auth forbidden');
 like(http_get('/error'), qr/ 500 /, 'auth error');
 like(http_get('/off'), qr/ 404 /, 'auth off');
 
+
 like(http_post('/open'), qr/ 404 /, 'auth post open');
 like(http_post('/unauthorized'), qr/ 401 /, 'auth post unauthorized');