Skip to content

Commit

Permalink
update reference.json (#273)
Browse files Browse the repository at this point in the history
Co-authored-by: ryepup <40441+ryepup@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and ryepup authored Oct 23, 2024
1 parent 59c1cd9 commit acdf952
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions reference-lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion reference-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nginx/reference-lib",
"version": "1.1.3",
"version": "1.1.4",
"description": "",
"main": "dist/index.js",
"type": "module",
Expand Down
6 changes: 3 additions & 3 deletions reference-lib/src/reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -4678,8 +4678,8 @@
"<p><em><code>function</code></em> | <em><code>module.function</code></em> [<em><code>buffer_type</code></em>=<em><code>string</code></em> | <em><code>buffer</code></em>]</p>\n"
],
"isBlock": false,
"description_md": "Sets an njs function as a response body filter.\nThe filter function is called for each data chunk of a response body\nwith the following arguments:\n\n- `r`\n\n the [HTTP request](https://nginx.org/en/docs/njs/reference.html#http) object\n- `data`\n\n the incoming data chunk,\n may be a string or Buffer\n depending on the `buffer_type` value,\n by default is a string.\n- `flags`\n\n an object with the following properties:\n - `last`\n \n a boolean value, true if data is a last buffer.\n\nThe filter function can pass its own modified version\nof the input data chunk to the next body filter by calling\n[`r.sendBuffer()`](https://nginx.org/en/docs/njs/reference.html#r_sendbuffer).\nFor example, to transform all the lowercase letters in the response body:\n```\nfunction filter(r, data, flags) {\n r.sendBuffer(data.toLowerCase(), flags);\n}\n```\nTo stop filtering (following data chunks will be passed to client\nwithout calling `js_body_filter`),\n[`r.done()`](https://nginx.org/en/docs/njs/reference.html#r_done)\ncan be used.\n\nIf the filter function changes the length of the response body, then\nit is required to clear out the \"Content-Length\" response header\n(if any) in\n[`js_header_filter`](https://nginx.org/en/docs/http/ngx_http_js_module.html#js_header_filter)\nto enforce chunked transfer encoding.\n\n> As the `js_body_filter` handler\n> returns its result immediately, it supports\n> only synchronous operations.\n> Thus, asynchronous operations such as\n> [r.subrequest()](https://nginx.org/en/docs/njs/reference.html#r_subrequest)\n> or\n> [setTimeout()](https://nginx.org/en/docs/njs/reference.html#settimeout)\n> are not supported.\n\n> The directive can be specified inside the\n> [if](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if) block\n> since [0.7.7](https://nginx.org/en/docs/njs/changes.html#njs0.7.7).",
"description_html": "<p>Sets an njs function as a response body filter.\nThe filter function is called for each data chunk of a response body\nwith the following arguments:</p>\n\n<ul>\n<li><p><code>r</code></p>\n\n<p>the <a href=\"https://nginx.org/en/docs/njs/reference.html#http\" target=\"_blank\">HTTP request</a> object</p></li>\n\n<li><p><code>data</code></p>\n\n<p>the incoming data chunk,\nmay be a string or Buffer\ndepending on the <code>buffer_type</code> value,\nby default is a string.</p></li>\n\n<li><p><code>flags</code></p>\n\n<p>an object with the following properties:</p>\n\n<ul>\n<li><p><code>last</code></p>\n\n<p>a boolean value, true if data is a last buffer.</p></li>\n</ul></li>\n</ul>\n\n<p>The filter function can pass its own modified version\nof the input data chunk to the next body filter by calling\n<a href=\"https://nginx.org/en/docs/njs/reference.html#r_sendbuffer\" target=\"_blank\"><code>r.sendBuffer()</code></a>.\nFor example, to transform all the lowercase letters in the response body:</p>\n\n<pre><code>function filter(r, data, flags) {\n r.sendBuffer(data.toLowerCase(), flags);\n}\n</code></pre>\n\n<p>To stop filtering (following data chunks will be passed to client\nwithout calling <code>js_body_filter</code>),\n<a href=\"https://nginx.org/en/docs/njs/reference.html#r_done\" target=\"_blank\"><code>r.done()</code></a>\ncan be used.</p>\n\n<p>If the filter function changes the length of the response body, then\nit is required to clear out the &ldquo;Content-Length&rdquo; response header\n(if any) in\n<a href=\"https://nginx.org/en/docs/http/ngx_http_js_module.html#js_header_filter\" target=\"_blank\"><code>js_header_filter</code></a>\nto enforce chunked transfer encoding.</p>\n\n<blockquote>\n<p>As the <code>js_body_filter</code> handler\nreturns its result immediately, it supports\nonly synchronous operations.\nThus, asynchronous operations such as\n<a href=\"https://nginx.org/en/docs/njs/reference.html#r_subrequest\" target=\"_blank\">r.subrequest()</a>\nor\n<a href=\"https://nginx.org/en/docs/njs/reference.html#settimeout\" target=\"_blank\">setTimeout()</a>\nare not supported.</p>\n\n<p>The directive can be specified inside the\n<a href=\"https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if\" target=\"_blank\">if</a> block\nsince <a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.7.7\" target=\"_blank\">0.7.7</a>.</p>\n</blockquote>\n"
"description_md": "Sets an njs function as a response body filter.\nThe filter function is called for each data chunk of a response body\nwith the following arguments:\n\n- `r`\n\n the [HTTP request](https://nginx.org/en/docs/njs/reference.html#http) object\n- `data`\n\n the incoming data chunk,\n may be a string or Buffer\n depending on the `buffer_type` value,\n by default is a string.\n Since [0.8.5](https://nginx.org/en/docs/njs/changes.html#njs0.8.5), the\n `data` value is implicitly converted to a valid UTF-8 string\n by default.\n For binary data, the `buffer_type` value\n should be set to `buffer`.\n- `flags`\n\n an object with the following properties:\n - `last`\n \n a boolean value, true if data is a last buffer.\n\nThe filter function can pass its own modified version\nof the input data chunk to the next body filter by calling\n[`r.sendBuffer()`](https://nginx.org/en/docs/njs/reference.html#r_sendbuffer).\nFor example, to transform all the lowercase letters in the response body:\n```\nfunction filter(r, data, flags) {\n r.sendBuffer(data.toLowerCase(), flags);\n}\n```\nTo stop filtering (following data chunks will be passed to client\nwithout calling `js_body_filter`),\n[`r.done()`](https://nginx.org/en/docs/njs/reference.html#r_done)\ncan be used.\n\nIf the filter function changes the length of the response body, then\nit is required to clear out the \"Content-Length\" response header\n(if any) in\n[`js_header_filter`](https://nginx.org/en/docs/http/ngx_http_js_module.html#js_header_filter)\nto enforce chunked transfer encoding.\n\n> As the `js_body_filter` handler\n> returns its result immediately, it supports\n> only synchronous operations.\n> Thus, asynchronous operations such as\n> [r.subrequest()](https://nginx.org/en/docs/njs/reference.html#r_subrequest)\n> or\n> [setTimeout()](https://nginx.org/en/docs/njs/reference.html#settimeout)\n> are not supported.\n\n> The directive can be specified inside the\n> [if](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if) block\n> since [0.7.7](https://nginx.org/en/docs/njs/changes.html#njs0.7.7).",
"description_html": "<p>Sets an njs function as a response body filter.\nThe filter function is called for each data chunk of a response body\nwith the following arguments:</p>\n\n<ul>\n<li><p><code>r</code></p>\n\n<p>the <a href=\"https://nginx.org/en/docs/njs/reference.html#http\" target=\"_blank\">HTTP request</a> object</p></li>\n\n<li><p><code>data</code></p>\n\n<p>the incoming data chunk,\nmay be a string or Buffer\ndepending on the <code>buffer_type</code> value,\nby default is a string.\nSince <a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.8.5\" target=\"_blank\">0.8.5</a>, the\n<code>data</code> value is implicitly converted to a valid UTF-8 string\nby default.\nFor binary data, the <code>buffer_type</code> value\nshould be set to <code>buffer</code>.</p></li>\n\n<li><p><code>flags</code></p>\n\n<p>an object with the following properties:</p>\n\n<ul>\n<li><p><code>last</code></p>\n\n<p>a boolean value, true if data is a last buffer.</p></li>\n</ul></li>\n</ul>\n\n<p>The filter function can pass its own modified version\nof the input data chunk to the next body filter by calling\n<a href=\"https://nginx.org/en/docs/njs/reference.html#r_sendbuffer\" target=\"_blank\"><code>r.sendBuffer()</code></a>.\nFor example, to transform all the lowercase letters in the response body:</p>\n\n<pre><code>function filter(r, data, flags) {\n r.sendBuffer(data.toLowerCase(), flags);\n}\n</code></pre>\n\n<p>To stop filtering (following data chunks will be passed to client\nwithout calling <code>js_body_filter</code>),\n<a href=\"https://nginx.org/en/docs/njs/reference.html#r_done\" target=\"_blank\"><code>r.done()</code></a>\ncan be used.</p>\n\n<p>If the filter function changes the length of the response body, then\nit is required to clear out the &ldquo;Content-Length&rdquo; response header\n(if any) in\n<a href=\"https://nginx.org/en/docs/http/ngx_http_js_module.html#js_header_filter\" target=\"_blank\"><code>js_header_filter</code></a>\nto enforce chunked transfer encoding.</p>\n\n<blockquote>\n<p>As the <code>js_body_filter</code> handler\nreturns its result immediately, it supports\nonly synchronous operations.\nThus, asynchronous operations such as\n<a href=\"https://nginx.org/en/docs/njs/reference.html#r_subrequest\" target=\"_blank\">r.subrequest()</a>\nor\n<a href=\"https://nginx.org/en/docs/njs/reference.html#settimeout\" target=\"_blank\">setTimeout()</a>\nare not supported.</p>\n\n<p>The directive can be specified inside the\n<a href=\"https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if\" target=\"_blank\">if</a> block\nsince <a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.7.7\" target=\"_blank\">0.7.7</a>.</p>\n</blockquote>\n"
},
{
"name": "js_content",
Expand Down Expand Up @@ -16456,5 +16456,5 @@
]
}
],
"version": "https://github.com/nginx/nginx.org/commit/2a84b6107338e8f3b8f1eb1862caf888ddde69bf"
"version": "https://github.com/nginx/nginx.org/commit/120efa0a24ae3e19529f7c94a11603699ced5472"
}

0 comments on commit acdf952

Please sign in to comment.