[PATCH 12 of 31] Fix predicate testing (*_cache_bypass, *_no_cache)

Maxim Dounin mdounin at mdounin.ru
Tue Feb 15 16:33:28 MSK 2011


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1297776694 -10800
# Node ID f4064857c04edf45bc2169e8a7ae90529bb463e1
# Parent  008754f4ad3836c522e55c9dd3cb3628509208f3
Fix predicate testing (*_cache_bypass, *_no_cache).

Values starting with '0' were incorrectly assumed to be false.

diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -265,7 +265,7 @@ ngx_http_test_predicates(ngx_http_reques
             return NGX_ERROR;
         }
 
-        if (val.len && val.data[0] != '0') {
+        if (val.len && (val.len != 1 || val.data[0] != '0')) {
             return NGX_DECLINED;
         }
     }



More information about the nginx-devel mailing list