regex valid_referers were not inherited

This commit is contained in:
Igor Sysoev 2007-12-27 12:13:11 +00:00
parent 99c3ab964f
commit 57c4b0a83b

View File

@ -242,6 +242,10 @@ ngx_http_referer_create_conf(ngx_conf_t *cf)
return NGX_CONF_ERROR;
}
#if (NGX_PCRE)
conf->regex = NGX_CONF_UNSET_PTR;
#endif
conf->no_referer = NGX_CONF_UNSET;
conf->blocked_referer = NGX_CONF_UNSET;
@ -260,6 +264,7 @@ ngx_http_referer_merge_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->keys == NULL) {
conf->hash = prev->hash;
ngx_conf_merge_ptr_value(conf->regex, prev->regex, NULL);
ngx_conf_merge_value(conf->no_referer, prev->no_referer, 0);
ngx_conf_merge_value(conf->blocked_referer, prev->blocked_referer, 0);
@ -335,6 +340,8 @@ ngx_http_referer_merge_conf(ngx_conf_t *cf, void *parent, void *child)
conf->hash.wc_tail = (ngx_hash_wildcard_t *) hash.hash;
}
ngx_conf_merge_ptr_value(conf->regex, prev->regex, NULL);
if (conf->no_referer == NGX_CONF_UNSET) {
conf->no_referer = 0;
}
@ -513,7 +520,7 @@ ngx_http_add_regex_referer(ngx_conf_t *cf, ngx_http_referer_conf_t *rlcf,
ngx_http_referer_regex_t *rr;
u_char errstr[NGX_MAX_CONF_ERRSTR];
if (rlcf->regex == NULL) {
if (rlcf->regex == NGX_CONF_UNSET_PTR) {
rlcf->regex = ngx_array_create(cf->pool, 2,
sizeof(ngx_http_referer_regex_t));
if (rlcf->regex == NULL) {