]> git.kaiwu.me - nginx.git/commitdiff
values starting with '0' were incorrectly assumed to be false
authorIgor Sysoev <igor@sysoev.ru>
Fri, 15 Apr 2011 12:24:18 +0000 (12:24 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 15 Apr 2011 12:24:18 +0000 (12:24 +0000)
patch by Maxim Dounin

src/http/ngx_http_script.c

index 8b861ce34dc7a4e87543bef8c241349999e4da6b..7c8de1445edb748e43a88c1cf091c2b2aa9d7934 100644 (file)
@@ -265,7 +265,7 @@ ngx_http_test_predicates(ngx_http_request_t *r, ngx_array_t *predicates)
             return NGX_ERROR;
         }
 
-        if (val.len && val.data[0] != '0') {
+        if (val.len && (val.len != 1 || val.data[0] != '0')) {
             return NGX_DECLINED;
         }
     }