Opensourcetechブログ

OpensourcetechによるNGINX/Kubernetes/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

nginx njs-0.5.0 released.


LinuCエヴァンジェリストの鯨井貴博@opensourcetechです。

nginxのJavaScriptモジュールであるnjs最新バージョン 0.5.0がリリースされました。
f:id:opensourcetech:20201205095754p:plain:w400
http://nginx.org/


更新内容は、以下の通り。
http://nginx.org/en/docs/njs/changes.html

Changes with njs 0.5.0
Release Date: 01 December 2020

nginx modules:
    Feature: introduced global ngx object.
    The following methods were added:
        ngx.log(level, message)
    The following properties were added:
        ngx.INFO, ngx.WARN, ngx.ERR.
    Feature: added support for Buffer object where string is expected.
    Feature: added Buffer version of existing properties.
    The following properties were added:
        r.requestBuffer (r.requestBody), r.responseBuffer (r.responseBody), r.rawVariables (r.variables), s.rawVariables (s.variables).
    The following events were added in the stream module:
        upstream (upload), downstream (download).
    Improvement: added aliases to existing properties.
    The following properties were added:
        r.requestText (r.requestBody), r.responseText (r.responseBody).
    Improvement: throwing an exception in r.internalRedirect() for a subrequest.
    Bugfix: fixed promise r.subrequest() with error_page redirect.
    Bugfix: fixed promise events handling.

Core:
    Feature: added TypeScript definitions for built-in modules. Thanks to Jakub Jirutka.
    Feature: tracking unhandled promise rejection.
    Feature: added initial iterator support. Thanks to Artem S. Povalyukhin.
    Improvement: TypeScript definitions are refactored. Thanks to Jakub Jirutka.
    Improvement: added forgotten support for Object.prototype.valueOf() in Buffer.from().
    Bugfix: fixed heap-use-after-free in JSON.parse().
    Bugfix: fixed heap-use-after-free in JSON.stringify().
    Bugfix: fixed JSON.stringify() for arrays resizable via getters.
    Bugfix: fixed heap-buffer-overflow for RegExp.prototype[Symbol.replace].
    Bugfix: fixed returned value for Buffer.prototype.write* functions.
    Bugfix: fixed querystring.stringify(). Thanks to Artem S. Povalyukhin.
    Bugfix: fixed the catch handler for Promise.prototype.finally().
    Bugfix: fixed querystring.parse().



日本語訳は、以下となります。

Changes with njs 0.5.0
Release Date: 01 December 2020

nginx modules:
機能追加:グローバルngxオブジェクトが導入されました。
次のメソッドが追加されました。
 ngx.log(レベル、メッセージ)
次のプロパティが追加されました。
 ngx.INFO、ngx.WARN、ngx.ERR
機能追加:文字列が予期されるBufferオブジェクトのサポートが追加されました。
機能追加:既存のプロパティのバッファバージョンが追加されました。
次のプロパティが追加されました。
 r.requestBuffer(r.requestBody)、r.responseBuffer(r.responseBody)、r.rawVariables(r.variables)、s.rawVariables(s.variables)。
次のイベントがストリームモジュールに追加されました。
 アップストリーム(アップロード)、ダウンストリーム(ダウンロード)。
改善:既存のプロパティに別名が追加されました。
次のプロパティが追加されました。
 r.requestText(r.requestBody)、r.responseText(r.responseBody)。
改善:サブリクエストに対してr.internalRedirect()で例外をスローする。
バグ修正:error_page redirectでpromise r.subrequest()が修正されました。
バグ修正:promiseイベント処理が修正されました。

Core:
機能追加:組み込みモジュールのTypeScript定義が追加されました。Jakub Jirutkaに感謝します。
機能追加:未処理のpromise拒否のトラッキング。
機能追加:初期イテレーターサポートが追加されました。Artem S. Povalyukhinに感謝します。
改善:TypeScript定義がリファクタリングされた。ヤクブ・Jirutkaのおかげだ
改善:Buffer.from()のObject.prototype.valueOf()の忘れ去られたサポートが追加されました。
バグ修正:JSON.parse()でのheap-use-after-freeが修正されました。
バグ修正:JSON.stringify()でのheap-use-after-freeが修正されました。
バグ修正:gettersでサイズ変更可能な配列のJSON.stringify()が修正されました。
バグ修正:RegExp.prototype[Symbol.replace]のheap-buffer-overflowが修正されました。
バグ修正:Buffer.prototype.write*関数の戻り値が修正されました。
バグ修正:querystring.stringify()が修正されました。Artem S. Povalyukhinに感謝します。
バグ修正:Promise.prototype.finally()のcatchハンドラが修正されました。
バグ修正:querystring.parse()が修正されました。

Opensourcetech by Takahiro Kujirai