mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 03:10:27 +00:00
Add some missing functions to the documentation
functions: - GetHttpReason - IsHiddenPath - IsAcceptablePath - IsReasonablePath - ProgramTimeout also fixed another typo
This commit is contained in:
parent
1a89a1b523
commit
c5a493ede2
1 changed files with 21 additions and 1 deletions
|
@ -1159,6 +1159,10 @@ FUNCTIONS
|
|||
HTTP/0.9, 10 for HTTP/1.0, or 11 for HTTP/1.1.
|
||||
Also available as GetVersion (deprecated).
|
||||
|
||||
GetHttpReason(code:int) → str
|
||||
Returns a string describing the HTTP reason phrase.
|
||||
See gethttpreason.c
|
||||
|
||||
GetRandomBytes([length:int]) → str
|
||||
Returns string with the specified number of random bytes (1..256).
|
||||
If no length is specified, then a string of length 16 is returned.
|
||||
|
@ -1181,6 +1185,9 @@ FUNCTIONS
|
|||
Programs redbean / listing page to not display any paths beginning
|
||||
with prefix. This function should only be called from /.init.lua.
|
||||
|
||||
IsHiddenPath(path:str) → bool
|
||||
Returns true if the prefix of the given path is set with HidePath.
|
||||
|
||||
IsPublicIp(uint32) → bool
|
||||
Returns true if IP address is not a private network (10.0.0.0/8,
|
||||
172.16.0.0/12, 192.168.0.0/16) and is not localhost (127.0.0.0/8).
|
||||
|
@ -1256,6 +1263,14 @@ FUNCTIONS
|
|||
like data:opaque, better in fact than most things which claim to
|
||||
be URI parsers.
|
||||
|
||||
IsAcceptablePath(str) → bool
|
||||
Returns true if path doesn't contain ".", ".." or "//" segments
|
||||
See isacceptablepath.c
|
||||
|
||||
IsReasonablePath(str) → bool
|
||||
Returns true if path doesn't contain "." or ".." segments.
|
||||
See isreasonablepath.c
|
||||
|
||||
EncodeUrl(URL) → str
|
||||
This function is the inverse of ParseUrl. The output will always
|
||||
be correctly formatted. The exception is if illegal characters are
|
||||
|
@ -1314,6 +1329,11 @@ FUNCTIONS
|
|||
as Content-Range and Date, which are abstracted by the transport
|
||||
layer.
|
||||
|
||||
ProgramTimeout(milliseconds:int|seconds:int)
|
||||
Default timeout is 60000ms. Minimal value of timeout is 10(ms).
|
||||
Negative values (<0) sets the keepalive in seconds.
|
||||
This should only be called from /.init.lua.
|
||||
|
||||
ProgramPort(uint16)
|
||||
Hard-codes the port number on which to listen, which can be any
|
||||
number in the range 1..65535, or alternatively 0 to ask the
|
||||
|
@ -1325,7 +1345,7 @@ FUNCTIONS
|
|||
default is very conservatively set to 65536 so this is
|
||||
something many people will want to increase. This limit is
|
||||
enforced at the transport layer, before any Lua code is
|
||||
called, because right now redbean stores and forewards
|
||||
called, because right now redbean stores and forwards
|
||||
messages. (Use the UNIX API for raw socket streaming.) Setting
|
||||
this to a very high value can be useful if you're less
|
||||
concerned about rogue clients and would rather have your Lua
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue