# HG changeset patch # User Sergey Kandaurov # Date 1544533833 -10800 # Node ID f5b18471e17a0c701f73bb94d852735eb3670f27 # Parent 215f3357034b82d769b0b7fea9bf8fe218f1f787 Tests: proxy cache background update with regex captures. diff --git a/proxy_cache_use_stale.t b/proxy_cache_use_stale.t --- a/proxy_cache_use_stale.t +++ b/proxy_cache_use_stale.t @@ -82,6 +82,12 @@ http { proxy_cache_background_update off; } + location ~ /(reg)(?Pexp).html { + proxy_pass http://127.0.0.1:8081/$1$name.html; + + proxy_cache_background_update on; + } + location /updating/ { proxy_pass http://127.0.0.1:8081/; @@ -143,8 +149,9 @@ EOF $t->write_file('ssi.html', 'xxx xxx'); $t->write_file('escape.html', 'SEE-THIS'); $t->write_file('escape html', 'SEE-THIS'); +$t->write_file('regexp.html', 'SEE-THIS'); -$t->run()->plan(33); +$t->run()->plan(35); ############################################################################### @@ -167,6 +174,7 @@ get('/updating/t2.html', 'max-age=1, sta get('/t8.html', 'stale-while-revalidate=10'); get('/escape.htm%6C', 'max-age=1, stale-while-revalidate=10'); get('/escape html', 'max-age=1, stale-while-revalidate=10'); +get('/regexp.html', 'max-age=1, stale-while-revalidate=10'); sleep 2; @@ -186,6 +194,17 @@ like(http_get('/t5.html?e=1'), qr/STALE/ 's-w-r - foreground revalidate error'); like(http_get('/t5.html'), qr/REVALIDATED/, 's-w-r - foreground revalidated'); +# proxy_pass to regular expression with named and positional captures + +like(http_get('/regexp.html'), qr/STALE/, 's-w-r - regexp background update'); + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.15.8'); + +like(http_get('/regexp.html'), qr/HIT/, 's-w-r - regexp revalidated'); + +} + # UPDATING while s-w-r $t->write_file('t6.html', 'SEE-THAT');