Mercurial > hg > nginx-tests
comparison proxy_store.t @ 306:f175dc25f249
Tests: proxy_store with HEAD requests.
Obsolete X-Accel-Expires test removed, as there are no plans to commit
long obsolete patch for X-Accel-Expires and proxy_store. Testing that
responses to HEAD requests are not stored is added instead.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 09 Jul 2013 17:06:52 +0400 |
parents | 6a0d934950bc |
children | 89cfb7397ba1 |
comparison
equal
deleted
inserted
replaced
305:f4aab0e66ed0 | 306:f175dc25f249 |
---|---|
44 proxy_store on; | 44 proxy_store on; |
45 } | 45 } |
46 location /ssi.html { | 46 location /ssi.html { |
47 ssi on; | 47 ssi on; |
48 } | 48 } |
49 location /index-nostore.html { | |
50 add_header X-Accel-Expires 0; | |
51 } | |
52 location /index-big.html { | 49 location /index-big.html { |
53 limit_rate 200k; | 50 limit_rate 200k; |
54 } | 51 } |
55 } | 52 } |
56 } | 53 } |
69 ############################################################################### | 66 ############################################################################### |
70 | 67 |
71 like(http_get('/store-index.html'), qr/SEE-THIS/, 'proxy request'); | 68 like(http_get('/store-index.html'), qr/SEE-THIS/, 'proxy request'); |
72 ok(-e $t->testdir() . '/store-index.html', 'result stored'); | 69 ok(-e $t->testdir() . '/store-index.html', 'result stored'); |
73 | 70 |
74 like(http_get('/store-index-nostore.html'), qr/SEE-THIS/, | 71 like(http_head('/store-index-nostore.html'), qr/200 OK/, 'head request'); |
75 'proxy request with x-accel-expires'); | |
76 | |
77 TODO: { | |
78 local $TODO = 'patch rejected'; | |
79 | |
80 ok(!-e $t->testdir() . '/store-index-nostore.html', 'result not stored'); | 72 ok(!-e $t->testdir() . '/store-index-nostore.html', 'result not stored'); |
81 } | |
82 | 73 |
83 ok(scalar @{[ glob $t->testdir() . '/proxy_temp/*' ]} == 0, 'no temp files'); | 74 ok(scalar @{[ glob $t->testdir() . '/proxy_temp/*' ]} == 0, 'no temp files'); |
84 | 75 |
85 http_get('/store-index-big.html', aborted => 1, sleep => 0.1); | 76 http_get('/store-index-big.html', aborted => 1, sleep => 0.1); |
86 | 77 |