Mercurial > hg > nginx-tests
changeset 999:ff12dfdb0cda
Tests: added test for the $limit_rate variable.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 29 Jul 2016 13:01:08 +0300 |
parents | 79ba0a5be312 |
children | 577a5899a33d |
files | http_variables.t |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/http_variables.t Wed Jul 27 19:41:59 2016 +0300 +++ b/http_variables.t Fri Jul 29 13:01:08 2016 +0300 @@ -59,6 +59,12 @@ expires epoch; proxy_pass http://127.0.0.1:8080/set; } + + location /limit_rate { + set $limit_rate 40k; + add_header X-Rate $limit_rate; + return 200 OK; + } } } @@ -72,6 +78,10 @@ http_get('/../bad_uri'); http_get('/redefine'); +# $limit_rate is a special variable that has its own set_handler / get_handler + +like(http_get('/limit_rate'), qr/X-Rate: 40960/, 'limit_rate handlers'); + $t->stop(); my $log = $t->read_file('cc.log');