Welcome! Log In Create A New Profile

Advanced

[njs] HTTP: added strict check for js_body_filter syntax.

Anonymous User
October 18, 2024 01:24AM
details: https://github.com/nginx/njs/commit/6ed70de1607fcf137cdfc120f68967f0bfd46829
branches: master
commit: 6ed70de1607fcf137cdfc120f68967f0bfd46829
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Thu, 17 Oct 2024 18:31:26 -0700
description:
HTTP: added strict check for js_body_filter syntax.


---
nginx/ngx_http_js_module.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index 6f026293..06429241 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -7921,20 +7921,24 @@ ngx_http_js_body_filter_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)

jlcf->buffer_type = NGX_JS_STRING;

- if (cf->args->nelts == 3
- && ngx_strncmp(value[2].data, "buffer_type=", 12) == 0)
- {
- if (ngx_strcmp(&value[2].data[12], "string") == 0) {
- jlcf->buffer_type = NGX_JS_STRING;
+ if (cf->args->nelts == 3) {
+ if (ngx_strncmp(value[2].data, "buffer_type=", 12) == 0) {
+ if (ngx_strcmp(&value[2].data[12], "string") == 0) {
+ jlcf->buffer_type = NGX_JS_STRING;

- } else if (ngx_strcmp(&value[2].data[12], "buffer") == 0) {
- jlcf->buffer_type = NGX_JS_BUFFER;
+ } else if (ngx_strcmp(&value[2].data[12], "buffer") == 0) {
+ jlcf->buffer_type = NGX_JS_BUFFER;

+ } else {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "invalid buffer_type value \"%V\", "
+ "it must be \"string\" or \"buffer\"",
+ &value[2]);
+ return NGX_CONF_ERROR;
+ }
} else {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid buffer_type value \"%V\", "
- "it must be \"string\" or \"buffer\"",
- &value[2]);
+ "invalid parameter \"%V\"", &value[2]);
return NGX_CONF_ERROR;
}
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] HTTP: added strict check for js_body_filter syntax.

Anonymous User 183 October 18, 2024 01:24AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 150
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready