Mercurial > hg > nginx-vendor-current
diff src/http/modules/ngx_http_map_module.c @ 628:83b58b182b76 NGINX_1_0_4
nginx 1.0.4
*) Change: now regular expressions case sensitivity in the "map"
directive is given by prefixes "~" or "~*".
*) Feature: now shared zones and caches use POSIX semaphores on Linux.
Thanks to Denis F. Latypoff.
*) Bugfix: "stalled" cache updating" alert.
*) Bugfix: nginx could not be built --without-http_auth_basic_module;
the bug had appeared in 1.0.3.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 01 Jun 2011 00:00:00 +0400 |
parents | 8214eaef3530 |
children | d0f7a625f27c |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_map_module.c +++ b/src/http/modules/ngx_http_map_module.c @@ -111,7 +111,6 @@ ngx_http_map_variable(ngx_http_request_t size_t len; ngx_str_t val; - ngx_uint_t key; ngx_http_variable_value_t *value; ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, @@ -127,9 +126,7 @@ ngx_http_map_variable(ngx_http_request_t len--; } - key = ngx_hash_strlow(val.data, val.data, len); - - value = ngx_http_map_find(r, &map->map, key, val.data, len, &val); + value = ngx_http_map_find(r, &map->map, &val); if (value == NULL) { value = map->default_value; @@ -529,6 +526,12 @@ found: ngx_memzero(&rc, sizeof(ngx_regex_compile_t)); + if (value[0].data[0] == '*') { + value[0].len--; + value[0].data++; + rc.options = NGX_REGEX_CASELESS; + } + rc.pattern = value[0]; rc.err.len = NGX_MAX_CONF_ERRSTR; rc.err.data = errstr;