]> git.kaiwu.me - njs.git/commitdiff
HTTP: avoid calling body filter when input chain is NULL.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 12 Sep 2023 03:34:48 +0000 (20:34 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 12 Sep 2023 03:34:48 +0000 (20:34 -0700)
This solves the problem of erroneous exception thrown in
r.internalRedirect() after 05c7f0b31856 (0.8.0).

nginx/ngx_http_js_module.c

index f881161764336fb80898117277f3e7edc5aeb0a3..6ba500e7e621edc6428f0ef8690bce9a996d162d 100644 (file)
@@ -1129,7 +1129,7 @@ ngx_http_js_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
 
     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);
     }