updated docs to reflect recent changes.
This commit is contained in:
Родитель
f229fccc52
Коммит
e7754953d6
33
README
33
README
|
@ -1756,7 +1756,7 @@ Nginx API for Lua
|
|||
See also ngx.req.set_uri.
|
||||
|
||||
ngx.req.get_uri_args
|
||||
syntax: *args = ngx.req.get_uri_args(count_limit?)*
|
||||
syntax: *args = ngx.req.get_uri_args(max_args?)*
|
||||
|
||||
context: *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*,
|
||||
header_filter_by_lua**
|
||||
|
@ -1822,7 +1822,7 @@ Nginx API for Lua
|
|||
arguments are silently discarded to guard against potential denial of
|
||||
service attacks.
|
||||
|
||||
However, the optional "count_limit" function argument can be used to
|
||||
However, the optional "max_args" function argument can be used to
|
||||
override this limit:
|
||||
|
||||
local args = ngx.req.get_uri_args(10)
|
||||
|
@ -1832,10 +1832,10 @@ Nginx API for Lua
|
|||
|
||||
local args = ngx.req.get_uri_args(0)
|
||||
|
||||
Removing the "count_limit" cap is strongly discouraged.
|
||||
Removing the "max_args" cap is strongly discouraged.
|
||||
|
||||
ngx.req.get_post_args
|
||||
syntax: *ngx.req.get_post_args(count_limit?)*
|
||||
syntax: *ngx.req.get_post_args(max_args?)*
|
||||
|
||||
context: *rewrite_by_lua*, access_by_lua*, content_by_lua*,
|
||||
header_filter_by_lua**
|
||||
|
@ -1905,7 +1905,7 @@ Nginx API for Lua
|
|||
arguments are silently discarded to guard against potential denial of
|
||||
service attacks.
|
||||
|
||||
However, the optional "count_limit" function argument can be used to
|
||||
However, the optional "max_args" function argument can be used to
|
||||
override this limit:
|
||||
|
||||
local args = ngx.req.get_post_args(10)
|
||||
|
@ -1915,10 +1915,10 @@ Nginx API for Lua
|
|||
|
||||
local args = ngx.req.get_post_args(0)
|
||||
|
||||
Removing the "count_limit" cap is strongly discouraged.
|
||||
Removing the "max_args" cap is strongly discouraged.
|
||||
|
||||
ngx.req.get_headers
|
||||
syntax: *headers = ngx.req.get_headers(count_limit?)*
|
||||
syntax: *headers = ngx.req.get_headers(max_headers?)*
|
||||
|
||||
context: *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*,
|
||||
header_filter_by_lua**
|
||||
|
@ -1954,7 +1954,7 @@ Nginx API for Lua
|
|||
are silently discarded to guard against potential denial of service
|
||||
attacks.
|
||||
|
||||
However, the optional "count_limit" function argument can be used to
|
||||
However, the optional "max_headers" function argument can be used to
|
||||
override this limit:
|
||||
|
||||
local args = ngx.req.get_headers(10)
|
||||
|
@ -1964,7 +1964,7 @@ Nginx API for Lua
|
|||
|
||||
local args = ngx.req.get_headers(0)
|
||||
|
||||
Removing the "count_limit" cap is strongly discouraged.
|
||||
Removing the "max_headers" cap is strongly discouraged.
|
||||
|
||||
ngx.req.set_header
|
||||
syntax: *ngx.req.set_header(header_name, header_value)*
|
||||
|
@ -2564,7 +2564,7 @@ Nginx API for Lua
|
|||
This method was first introduced in the "v0.3.1rc27" release.
|
||||
|
||||
ngx.decode_args
|
||||
syntax: *table = ngx.decode_args(str)*
|
||||
syntax: *table = ngx.decode_args(str, max_args?)*
|
||||
|
||||
context: *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*,
|
||||
header_filter_by_lua**
|
||||
|
@ -2572,6 +2572,19 @@ Nginx API for Lua
|
|||
Decodes a URI encoded query-string into a Lua table. This is the inverse
|
||||
function of ngx.encode_args.
|
||||
|
||||
The optional "max_args" argument can be used to specify the
|
||||
maximalnumber of arguments parsed from the "str" argument. By default, a
|
||||
maximum of 100 request arguments are parsed (including those with the
|
||||
same name) and that additional URI arguments are silently discarded to
|
||||
guard against potential denial of service attacks.
|
||||
|
||||
This argument can be set to zero to remove the limit and to process all
|
||||
request arguments received:
|
||||
|
||||
local args = ngx.decode_args(str, 0)
|
||||
|
||||
Removing the "max_args" cap is strongly discouraged.
|
||||
|
||||
This method was introduced in the "v0.5.0rc29".
|
||||
|
||||
ngx.encode_base64
|
||||
|
|
|
@ -1683,7 +1683,7 @@ See also [ngx.req.set_uri](http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri).
|
|||
|
||||
ngx.req.get_uri_args
|
||||
--------------------
|
||||
**syntax:** *args = ngx.req.get_uri_args(count_limit?)*
|
||||
**syntax:** *args = ngx.req.get_uri_args(max_args?)*
|
||||
|
||||
**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua**
|
||||
|
||||
|
@ -1750,9 +1750,9 @@ Here the `args` table will always look like
|
|||
|
||||
regardless of the actual request query string.
|
||||
|
||||
Note that a maximum of 100 request arguments are parsed by default (including those with the same name) and that additional request arguments are silently discarded to guard against potential denial of service attacks.
|
||||
Note that a maximum of 100 request arguments are parsed by default (including those with the same name) and that additional request arguments are silently discarded to guard against potential denial of service attacks.
|
||||
|
||||
However, the optional `count_limit` function argument can be used to override this limit:
|
||||
However, the optional `max_args` function argument can be used to override this limit:
|
||||
|
||||
|
||||
local args = ngx.req.get_uri_args(10)
|
||||
|
@ -1764,11 +1764,11 @@ This argument can be set to zero to remove the limit and to process all request
|
|||
local args = ngx.req.get_uri_args(0)
|
||||
|
||||
|
||||
Removing the `count_limit` cap is strongly discouraged.
|
||||
Removing the `max_args` cap is strongly discouraged.
|
||||
|
||||
ngx.req.get_post_args
|
||||
---------------------
|
||||
**syntax:** *ngx.req.get_post_args(count_limit?)*
|
||||
**syntax:** *ngx.req.get_post_args(max_args?)*
|
||||
|
||||
**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua**
|
||||
|
||||
|
@ -1839,7 +1839,7 @@ Empty key arguments are discarded. `POST /test` with body `=hello&=world` will y
|
|||
|
||||
Note that a maximum of 100 request arguments are parsed by default (including those with the same name) and that additional request arguments are silently discarded to guard against potential denial of service attacks.
|
||||
|
||||
However, the optional `count_limit` function argument can be used to override this limit:
|
||||
However, the optional `max_args` function argument can be used to override this limit:
|
||||
|
||||
|
||||
local args = ngx.req.get_post_args(10)
|
||||
|
@ -1851,11 +1851,11 @@ This argument can be set to zero to remove the limit and to process all request
|
|||
local args = ngx.req.get_post_args(0)
|
||||
|
||||
|
||||
Removing the `count_limit` cap is strongly discouraged.
|
||||
Removing the `max_args` cap is strongly discouraged.
|
||||
|
||||
ngx.req.get_headers
|
||||
-------------------
|
||||
**syntax:** *headers = ngx.req.get_headers(count_limit?)*
|
||||
**syntax:** *headers = ngx.req.get_headers(max_headers?)*
|
||||
|
||||
**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua**
|
||||
|
||||
|
@ -1892,7 +1892,7 @@ the value of `ngx.req.get_headers()["Foo"]` will be a Lua (array) table such as:
|
|||
|
||||
Note that a maximum of 100 request headers are parsed by default (including those with the same name) and that additional request headers are silently discarded to guard against potential denial of service attacks.
|
||||
|
||||
However, the optional `count_limit` function argument can be used to override this limit:
|
||||
However, the optional `max_headers` function argument can be used to override this limit:
|
||||
|
||||
|
||||
local args = ngx.req.get_headers(10)
|
||||
|
@ -1904,7 +1904,7 @@ This argument can be set to zero to remove the limit and to process all request
|
|||
local args = ngx.req.get_headers(0)
|
||||
|
||||
|
||||
Removing the `count_limit` cap is strongly discouraged.
|
||||
Removing the `max_headers` cap is strongly discouraged.
|
||||
|
||||
ngx.req.set_header
|
||||
------------------
|
||||
|
@ -2449,12 +2449,22 @@ This method was first introduced in the `v0.3.1rc27` release.
|
|||
|
||||
ngx.decode_args
|
||||
---------------
|
||||
**syntax:** *table = ngx.decode_args(str)*
|
||||
**syntax:** *table = ngx.decode_args(str, max_args?)*
|
||||
|
||||
**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua**
|
||||
|
||||
Decodes a URI encoded query-string into a Lua table. This is the inverse function of [ngx.encode_args](http://wiki.nginx.org/HttpLuaModule#ngx.encode_args).
|
||||
|
||||
The optional `max_args` argument can be used to specify the maximalnumber of arguments parsed from the `str` argument. By default, a maximum of 100 request arguments are parsed (including those with the same name) and that additional URI arguments are silently discarded to guard against potential denial of service attacks.
|
||||
|
||||
This argument can be set to zero to remove the limit and to process all request arguments received:
|
||||
|
||||
|
||||
local args = ngx.decode_args(str, 0)
|
||||
|
||||
|
||||
Removing the `max_args` cap is strongly discouraged.
|
||||
|
||||
This method was introduced in the `v0.5.0rc29`.
|
||||
|
||||
ngx.encode_base64
|
||||
|
|
|
@ -1715,7 +1715,7 @@ This argument can be set to zero to remove the limit and to process all request
|
|||
Removing the <code>max_args</code> cap is strongly discouraged.
|
||||
|
||||
== ngx.req.get_post_args ==
|
||||
'''syntax:''' ''ngx.req.get_post_args(count_limit?)''
|
||||
'''syntax:''' ''ngx.req.get_post_args(max_args?)''
|
||||
|
||||
'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*''
|
||||
|
||||
|
@ -1786,7 +1786,7 @@ Empty key arguments are discarded. <code>POST /test</code> with body <code>=hell
|
|||
|
||||
Note that a maximum of 100 request arguments are parsed by default (including those with the same name) and that additional request arguments are silently discarded to guard against potential denial of service attacks.
|
||||
|
||||
However, the optional <code>count_limit</code> function argument can be used to override this limit:
|
||||
However, the optional <code>max_args</code> function argument can be used to override this limit:
|
||||
|
||||
<geshi lang="lua">
|
||||
local args = ngx.req.get_post_args(10)
|
||||
|
@ -1798,10 +1798,10 @@ This argument can be set to zero to remove the limit and to process all request
|
|||
local args = ngx.req.get_post_args(0)
|
||||
</geshi>
|
||||
|
||||
Removing the <code>count_limit</code> cap is strongly discouraged.
|
||||
Removing the <code>max_args</code> cap is strongly discouraged.
|
||||
|
||||
== ngx.req.get_headers ==
|
||||
'''syntax:''' ''headers = ngx.req.get_headers(count_limit?)''
|
||||
'''syntax:''' ''headers = ngx.req.get_headers(max_headers?)''
|
||||
|
||||
'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*''
|
||||
|
||||
|
@ -1838,7 +1838,7 @@ the value of <code>ngx.req.get_headers()["Foo"]</code> will be a Lua (array) tab
|
|||
|
||||
Note that a maximum of 100 request headers are parsed by default (including those with the same name) and that additional request headers are silently discarded to guard against potential denial of service attacks.
|
||||
|
||||
However, the optional <code>count_limit</code> function argument can be used to override this limit:
|
||||
However, the optional <code>max_headers</code> function argument can be used to override this limit:
|
||||
|
||||
<geshi lang="lua">
|
||||
local args = ngx.req.get_headers(10)
|
||||
|
@ -1850,7 +1850,7 @@ This argument can be set to zero to remove the limit and to process all request
|
|||
local args = ngx.req.get_headers(0)
|
||||
</geshi>
|
||||
|
||||
Removing the <code>count_limit</code> cap is strongly discouraged.
|
||||
Removing the <code>max_headers</code> cap is strongly discouraged.
|
||||
|
||||
== ngx.req.set_header ==
|
||||
'''syntax:''' ''ngx.req.set_header(header_name, header_value)''
|
||||
|
@ -2378,11 +2378,7 @@ This method was first introduced in the <code>v0.3.1rc27</code> release.
|
|||
|
||||
Decodes a URI encoded query-string into a Lua table. This is the inverse function of [[#ngx.encode_args|ngx.encode_args]].
|
||||
|
||||
The optional <code>max_args</code> argument can be used to specify the maximal
|
||||
number of arguments parsed from the <code>str</code> argument. By default, a
|
||||
maximum of 100 request arguments are parsed (including those with the same name)
|
||||
and that additional URI arguments are silently discarded to guard
|
||||
against potential denial of service attacks.
|
||||
The optional <code>max_args</code> argument can be used to specify the maximalnumber of arguments parsed from the <code>str</code> argument. By default, a maximum of 100 request arguments are parsed (including those with the same name) and that additional URI arguments are silently discarded to guard against potential denial of service attacks.
|
||||
|
||||
This argument can be set to zero to remove the limit and to process all request arguments received:
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче