]> git.kaiwu.me - nginx.git/commitdiff
allow empty value as "map" parameter
authorIgor Sysoev <igor@sysoev.ru>
Thu, 25 Nov 2010 15:24:29 +0000 (15:24 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 25 Nov 2010 15:24:29 +0000 (15:24 +0000)
src/http/modules/ngx_http_map_module.c

index 6587cc54e62401c42a8ea498f4556c0a15775374..8f925a10ca1f652d7277c427b2c20c25cbe514e6 100644 (file)
@@ -122,11 +122,6 @@ ngx_http_map_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
         len--;
     }
 
-    if (len == 0) {
-        *v = *map->default_value;
-        return NGX_OK;
-    }
-
     key = ngx_hash_strlow(val.data, val.data, len);
 
     value = ngx_hash_find_combined(&map->hash, key, val.data, len);
@@ -357,11 +352,6 @@ ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                            "invalid number of the map parameters");
         return NGX_CONF_ERROR;
-
-    } else if (value[0].len == 0) {
-        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                           "invalid first parameter");
-        return NGX_CONF_ERROR;
     }
 
     if (ngx_strcmp(value[0].data, "include") == 0) {