From: Dmitry Volyntsev Date: Tue, 12 Sep 2023 03:34:48 +0000 (-0700) Subject: HTTP: avoid calling body filter when input chain is NULL. X-Git-Tag: 0.8.1~2 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=606f5c0d43f357a99ca36225f9d07e33d15a2953;p=njs.git 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). --- diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index f8811617..6ba500e7 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -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); }