diff options
author | Dmitry Volyntsev <xeioex@nginx.com> | 2024-04-08 22:47:24 -0700 |
---|---|---|
committer | Dmitry Volyntsev <xeioex@nginx.com> | 2024-04-08 22:47:24 -0700 |
commit | 35ee442e9666cc8729839ee6f4cc064a29c8282c (patch) | |
tree | b70663530dfd89f1d972585d1c2aec33a4eea646 /nginx/ngx_http_js_module.c | |
parent | 076ca079d63d7d0bb777cc7a6f9b69df9c578192 (diff) | |
download | njs-35ee442e9666cc8729839ee6f4cc064a29c8282c.tar.gz njs-35ee442e9666cc8729839ee6f4cc064a29c8282c.zip |
Modules: checking for duplicate js_set variables.
This closes #700 issue on Github.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r-- | nginx/ngx_http_js_module.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index c6249548..21bcc26a 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -4773,6 +4773,12 @@ ngx_http_js_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) *fname = value[2]; + if (v->get_handler == ngx_http_js_variable_set) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "variable \"%V\" is already declared", &value[1]); + return NGX_CONF_ERROR; + } + v->get_handler = ngx_http_js_variable_set; v->data = (uintptr_t) fname; |