]> git.kaiwu.me - njs.git/commit
Modules: fixed js_set with Buffer values.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 21 Nov 2023 16:57:03 +0000 (08:57 -0800)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 21 Nov 2023 16:57:03 +0000 (08:57 -0800)
commit2743bab180ab067ea6d146c92a30a7f88bff7b2a
tree573308bd4ee0c623627bd7eb48ce6b6f67cd195e
parent62d0d45611cf8eaab28ec7a64d4bb9b12b3513c0
Modules: fixed js_set with Buffer values.

Previously, a Buffer value which contains invalid UTF-8 when returned as a
value for js_set handler was mangled because the bytes value was converted to a
string value.

The fix is to use bytes value of Buffer, TypedArray and ArrayBuffer as is,
and not convert it to a string first.
nginx/ngx_http_js_module.c
nginx/ngx_stream_js_module.c
nginx/t/js.t
nginx/t/stream_js.t