mirror of
https://github.com/nginx/nginx.git
synced 2025-01-19 01:42:58 +08:00
regex valid_referers were not inherited
This commit is contained in:
parent
99c3ab964f
commit
57c4b0a83b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user