]> git.kaiwu.me - njs.git/commit
Fixed js_body_filter when data is not in memory.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 2 Dec 2025 01:03:25 +0000 (17:03 -0800)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 2 Dec 2025 22:06:59 +0000 (14:06 -0800)
commit81e4a3eaa4b9d8a88a46646da9a76e8309f956e7
tree2dcbebdf2791633bd15382e3166b4bf6ed5e6173
parent8ba1ecb414f6f6c77cb88fe2458869097ae6bb5f
Fixed js_body_filter when data is not in memory.

Previously, when upstream data was delivered from nginx cache
js_body_filter was not able to process it correctly. In particular,
it was treated as a chain of empty buffers.

The fix is to set r->filter_need_in_memory flag, which ensures
that ngx_http_core_module reads the data into memory before
js_body_filter sees it.

This fixes #992 issue on Github.
nginx/ngx_http_js_module.c
nginx/t/js_body_filter_file.t [new file with mode: 0644]