comparison proxy_cache_use_stale.t @ 1707:e3dd111410fe

Tests: removed spaces in URI in various other tests.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 28 Jun 2021 17:13:44 +0300
parents 4b808861a318
children
comparison
equal deleted inserted replaced
1706:9c79f41fdf9b 1707:e3dd111410fe
146 $t->write_file('t6.html', 'SEE-THIS'); 146 $t->write_file('t6.html', 'SEE-THIS');
147 $t->write_file('t7.html', 'SEE-THIS' x 1024); 147 $t->write_file('t7.html', 'SEE-THIS' x 1024);
148 $t->write_file('t9.html', 'SEE-THIS' x 1024); 148 $t->write_file('t9.html', 'SEE-THIS' x 1024);
149 $t->write_file('ssi.html', 'xxx <!--#include virtual="/t9.html" --> xxx'); 149 $t->write_file('ssi.html', 'xxx <!--#include virtual="/t9.html" --> xxx');
150 $t->write_file('escape.html', 'SEE-THIS'); 150 $t->write_file('escape.html', 'SEE-THIS');
151 $t->write_file('escape html', 'SEE-THIS');
152 $t->write_file('regexp.html', 'SEE-THIS'); 151 $t->write_file('regexp.html', 'SEE-THIS');
153 152
154 $t->run()->plan(36); 153 $t->run()->plan(34);
155 154
156 ############################################################################### 155 ###############################################################################
157 156
158 like(get('/t.html', 'max-age=1, stale-if-error=5'), qr/MISS/, 'stale-if-error'); 157 like(get('/t.html', 'max-age=1, stale-if-error=5'), qr/MISS/, 'stale-if-error');
159 like(http_get('/t.html?e=1'), qr/HIT/, 's-i-e - cached'); 158 like(http_get('/t.html?e=1'), qr/HIT/, 's-i-e - cached');
172 get('/updating/t.html', 'max-age=1'); 171 get('/updating/t.html', 'max-age=1');
173 get('/updating/t2.html', 'max-age=1, stale-while-revalidate=2'); 172 get('/updating/t2.html', 'max-age=1, stale-while-revalidate=2');
174 get('/updating/tt.html', 'max-age=1, stale-if-error=5'); 173 get('/updating/tt.html', 'max-age=1, stale-if-error=5');
175 get('/t8.html', 'stale-while-revalidate=10'); 174 get('/t8.html', 'stale-while-revalidate=10');
176 get('/escape.htm%6C', 'max-age=1, stale-while-revalidate=10'); 175 get('/escape.htm%6C', 'max-age=1, stale-while-revalidate=10');
177 get('/escape html', 'max-age=1, stale-while-revalidate=10');
178 get('/regexp.html', 'max-age=1, stale-while-revalidate=10'); 176 get('/regexp.html', 'max-age=1, stale-while-revalidate=10');
179 177
180 sleep 2; 178 sleep 2;
181 179
182 # stale 5xx response is ignored since 1.19.3, 180 # stale 5xx response is ignored since 1.19.3,
261 like(http_get('/t2.html?if=1'), qr/HIT/, 'background update in if - updated'); 259 like(http_get('/t2.html?if=1'), qr/HIT/, 'background update in if - updated');
262 260
263 # ticket #1430, uri escaping in cloned subrequests 261 # ticket #1430, uri escaping in cloned subrequests
264 262
265 $t->write_file('escape.html', 'SEE-THAT'); 263 $t->write_file('escape.html', 'SEE-THAT');
266 $t->write_file('escape html', 'SEE-THAT');
267 264
268 get('/escape.htm%6C', 'max-age=1'); 265 get('/escape.htm%6C', 'max-age=1');
269 get('/escape html', 'max-age=1');
270 266
271 like(http_get('/escape.htm%6C'), qr/HIT/, 'escaped after escaped'); 267 like(http_get('/escape.htm%6C'), qr/HIT/, 'escaped after escaped');
272 like(http_get('/escape.html'), qr/MISS/, 'unescaped after escaped'); 268 like(http_get('/escape.html'), qr/MISS/, 'unescaped after escaped');
273 like(http_get('/escape html'), qr/HIT/, 'space after escaped space');
274 like(http_get('/escape%20html'), qr/HIT/, 'escaped space after escaped space');
275 269
276 ############################################################################### 270 ###############################################################################
277 271
278 sub get { 272 sub get {
279 my ($url, $extra, %extra) = @_; 273 my ($url, $extra, %extra) = @_;