[njs] HTTP: avoid calling body filter when input chain is NULL.

Dmitry Volyntsev xeioex at nginx.com
Tue Sep 12 03:35:40 UTC 2023


details:   https://hg.nginx.org/njs/rev/6b3176692593
branches:  
changeset: 2198:6b3176692593
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon Sep 11 20:34:48 2023 -0700
description:
HTTP: avoid calling body filter when input chain is NULL.

This solves the problem of erroneous exception thrown in
r.internalRedirect() after 05c7f0b31856 (0.8.0).

diffstat:

 nginx/ngx_http_js_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 1ac5ae749ae1 -r 6b3176692593 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Fri Sep 08 17:13:19 2023 -0700
+++ b/nginx/ngx_http_js_module.c	Mon Sep 11 20:34:48 2023 -0700
@@ -1129,7 +1129,7 @@ ngx_http_js_body_filter(ngx_http_request
 
     jlcf = ngx_http_get_module_loc_conf(r, ngx_http_js_module);
 
-    if (jlcf->body_filter.len == 0) {
+    if (jlcf->body_filter.len == 0 || in == NULL) {
         return ngx_http_next_body_filter(r, in);
     }
 


More information about the nginx-devel mailing list