# HG changeset patch # User Yaroslav Zhuravlev # Date 1615315496 0 # Node ID 893cd7724c8c58d89e1addcf23cffa911d247488 # Parent e87c0ffc3492db5997231a586a764e8c519c94d8 Documented the "r" argument for js_body_filter. diff --git a/xml/en/docs/http/ngx_http_js_module.xml b/xml/en/docs/http/ngx_http_js_module.xml --- a/xml/en/docs/http/ngx_http_js_module.xml +++ b/xml/en/docs/http/ngx_http_js_module.xml @@ -9,7 +9,7 @@ + rev="25">
@@ -132,6 +132,11 @@ The filter function is called for each d with the following arguments: +r + +the HTTP request object + + data the incoming data chunk, @@ -161,7 +166,7 @@ of the input data chunk to the next body r.sendBuffer(). For example, to transform all the lowercase letters in the response body: -function filter(data, flags) { +function filter(r, data, flags) { r.sendBuffer(data.toLowerCase(), flags); } diff --git a/xml/ru/docs/http/ngx_http_js_module.xml b/xml/ru/docs/http/ngx_http_js_module.xml --- a/xml/ru/docs/http/ngx_http_js_module.xml +++ b/xml/ru/docs/http/ngx_http_js_module.xml @@ -9,7 +9,7 @@ + rev="25">
@@ -132,6 +132,11 @@ export default {foo, summary, baz, hello со следующими аргументами: +r + +объект HTTP request + + data входящий блок данных @@ -161,7 +166,7 @@ export default {foo, summary, baz, hello r.sendBuffer(). Пример преобразования букв в нижний регистр в теле ответа: -function filter(data, flags) { +function filter(r, data, flags) { r.sendBuffer(data.toLowerCase(), flags); }