regex valid_referers were not inherited
diff --git a/src/http/modules/ngx_http_referer_module.c b/src/http/modules/ngx_http_referer_module.c
index 0076e94..40d9682 100644
--- a/src/http/modules/ngx_http_referer_module.c
+++ b/src/http/modules/ngx_http_referer_module.c
@@ -242,6 +242,10 @@
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 @@
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 @@
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_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) {