Mercurial > hg > nginx-tests
comparison auth_request.t @ 1344:856ab7671404
Tests: reverted changes in auth_request.t introduced in 2ff483941037.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Wed, 13 Jun 2018 15:15:19 +0300 |
parents | 2ff483941037 |
children | 83ec64929612 |
comparison
equal
deleted
inserted
replaced
1343:2ff483941037 | 1344:856ab7671404 |
---|---|
54 auth_request /auth-open; | 54 auth_request /auth-open; |
55 } | 55 } |
56 location = /auth-open { | 56 location = /auth-open { |
57 return 204; | 57 return 204; |
58 } | 58 } |
59 | |
60 location /auth_file { | |
61 auth_request /file/t; | |
62 } | |
63 | |
64 location /file/ { | |
65 alias %%TESTDIR%%/; | |
66 } | |
67 | |
68 | 59 |
69 location /open-static { | 60 location /open-static { |
70 auth_request /auth-open-static; | 61 auth_request /auth-open-static; |
71 } | 62 } |
72 location = /auth-open-static { | 63 location = /auth-open-static { |
151 EOF | 142 EOF |
152 | 143 |
153 $t->write_file('htpasswd', 'user:{PLAIN}secret' . "\n"); | 144 $t->write_file('htpasswd', 'user:{PLAIN}secret' . "\n"); |
154 $t->write_file('auth-basic', 'INVISIBLE'); | 145 $t->write_file('auth-basic', 'INVISIBLE'); |
155 $t->write_file('auth-open-static', 'INVISIBLE'); | 146 $t->write_file('auth-open-static', 'INVISIBLE'); |
156 $t->write_file('t', '["SEE-THIS"]'); | |
157 $t->run(); | 147 $t->run(); |
158 | 148 |
159 ############################################################################### | 149 ############################################################################### |
160 | 150 |
161 like(http_get('/auth_file'), qr/ 200 /, 'auth file'); | |
162 like(http_get('/open'), qr/ 404 /, 'auth open'); | 151 like(http_get('/open'), qr/ 404 /, 'auth open'); |
163 like(http_get('/unauthorized'), qr/ 401 /, 'auth unauthorized'); | 152 like(http_get('/unauthorized'), qr/ 401 /, 'auth unauthorized'); |
164 like(http_get('/forbidden'), qr/ 403 /, 'auth forbidden'); | 153 like(http_get('/forbidden'), qr/ 403 /, 'auth forbidden'); |
165 like(http_get('/error'), qr/ 500 /, 'auth error'); | 154 like(http_get('/error'), qr/ 500 /, 'auth error'); |
166 like(http_get('/off'), qr/ 404 /, 'auth off'); | 155 like(http_get('/off'), qr/ 404 /, 'auth off'); |
167 | |
168 | 156 |
169 like(http_post('/open'), qr/ 404 /, 'auth post open'); | 157 like(http_post('/open'), qr/ 404 /, 'auth post open'); |
170 like(http_post('/unauthorized'), qr/ 401 /, 'auth post unauthorized'); | 158 like(http_post('/unauthorized'), qr/ 401 /, 'auth post unauthorized'); |
171 | 159 |
172 like(http_get('/open-static'), qr/ 404 /, 'auth open static'); | 160 like(http_get('/open-static'), qr/ 404 /, 'auth open static'); |