| Commit message (Collapse) | Author | Age |
... | |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an initial implementation of Fetch API.
The following init options are supported:
body, headers, buffer_size (nginx specific), max_response_body_size
(nginx specific), method.
The following properties and methods of Response object are implemented:
arrayBuffer(), bodyUsed, json(), headers, ok, redirect, status, statusText,
text(), type, url.
The following properties and methods of Header object are implemented:
get(), getAll(), has().
Notable limitations: only http:// scheme is supported, redirects
are not handled.
In collaboration with 洪志道 (Hong Zhi Dao).
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, njs_vm_external_prototype() returned the pointer to a
created prototype structure. Which were expected to be passed to
njs_vm_external_create() as is. The returned pointer is needed to be
stored somewhere by user code which complicates user code in cases when
many prototypes are created.
Instead, an index in the VM internal table is returned.
njs_vm_external_create() is changed accordingly. This simplifies
user code because the index is known at static time for most cases.
|
|
|
|
|
|
|
|
|
| |
In 434f20c29f4c, r.reqBody and r.resBody were introduced. Since quite
often request body and response body are valid strings, it is preferable
to leave both variants to avoid potential conversions.
To make distinction clearer, requestText and responseText aliases to
requestBody and responseBody were also added.
|
|
|
|
|
|
|
|
|
|
| |
In 434f20c29f4c, obj.vars was introduced. obj.vars is almost identical
to obj.variables except a value of the Buffer type is returned.
Since most nginx variables are valid strings, it is preferable to
leave both variants.
To avoid confusion rawVariables name is used for Buffer variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Buffer variant returns the property bytes as is, whereas the string
version may convert bytes invalid in UTF-8 encoding into replacement
character.
HTTP
new request object properties:
r.reqBody (r.requestBody),
r.resBody (r.responseBody),
r.vars (r.variables).
Stream
new stream object properties:
s.vars (s.variables).
new events:
The events' callbacks are identical to the string counterparts, except the data
argument:
upstream (upload),
downstream (download).
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, promise callbacks for a subrequest were stored in a
subrequest context. This is incorrect because a subrequest content may
be destroyed (for example when error_page with redirect is enabled for a
subrequest location).
The fix is to store callbacks in the parent context.
The issue was introduced in 6fccbc9f1288 (0.3.8).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
By default, promises should finish processing normally for .then(),
.catch(), .finally() and so on. The patch adds the ability to report
unhandled exception from promises to the user.
This closes #346 issue on GitHub.
|
|
|
|
| |
This closes #214 issue on GitHub.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
1) r.rawHeadersIn returns an array of key-value pairs exactly as they
were received from the client.
2) r.rawHeadersOut returns an array of key-value pairs of respose
headers.
Header names are not lowercased, and duplicates are not merged.
|
|
|
|
| |
This fixes #305 issue on Github.
|
| |
|
|
|
|
|
|
|
| |
1) Duplicates of Content-Type, ETag, From, Max-Forwards, Referer,
Proxy-Authorization, User-Agent are ignored.
2) Duplicate Cookie headers are joined together with ';'.
3) All other duplicate header values are joined together with ','.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Added support for an array of values in assignments:
r.headersOut['Set-Cookie'] = ['a', '', 'b'] will result in
Set-Cookie: a
Set-Cookie: b
headers in output. All previous Set-Cookie are deleted.
Only the last element in the table will take effect for standard
headers such as Content-Type that only accept a single value.
r.headersOut.foo = [] is the same as
delete r.headersOut.foo
2) Improved getting of special arrays:
Set-Cookie is always returned as an array.
Duplicates of Age, Content-Length, Content-Type, ETag, Expires,
Last-Modified, Location, Retry-After are ignored.
All other duplicate header values are joined together with ','.
This closes #266 issue on Github.
|
|
|
|
|
| |
In 9e327cd3a33e duplicates were filtered out only for Cookie and
X-Forwarded-For.
|
|
|
|
|
|
| |
In f6234460852a getting of special headers "Content-Type" and
"Content-Length" was introduced. Still these headers were invisible
during iteration over r.headersOut object.
|
| |
|
| |
|
| |
|
|
|
|
| |
Missed in b758915e2406.
|
|
|
|
| |
This closes #16 issue on Github.
|
|
|
|
|
|
|
|
| |
If "options.detached" boolean flag is true the created subrequest is
a detached subrequest. Responses to detached subrequest are ignored.
Unlike ordinary subrequests, a detached subrequest can be created
inside a variable handler. The detached flag and callback argument are
mutually exclusive.
|
|
|
|
|
| |
If callback is not provided r.subrequest() returns an ordinary
Promise object that resolves to subrequest response object.
|
|
|
|
|
|
|
|
|
| |
Previously, r.parent handler threw an exception if it was called not for
a subrequest. This is too restrictive, as it prevents any iterations
over all r properties (for example: JSON.stringify()).
Instead, "undefined" value is returned as it is already done for
r.requestBody when request body is unavailable.
|
| |
|
|
|
|
|
|
|
| |
Previously, two callbacks were required to support
array-like iteration for external objects (foreach, next).
Instead using only one callback (keys) to simplify.
|
|
|
|
|
|
|
| |
If multiple "Cookie" or "X-Forwarded-For" are present they
are combined into a single return value.
This closes #201 issue on Github.
|
|
|
|
|
|
|
|
| |
Previously njs_arg() returned expression of type (const njs_value_t *).
This caused a lot of casts when calling functions and forced to declared
const njs_value_t * variables.
NO functional changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently njs_ret_t is used in 2 different cases: as a jump offset for
bytecode and as a return value for ordinary functions. The second case
is quite similar with njs_int_t (and is often confused with).
1) Splitting this two cases into different types to avoid
confusion with njs_int_t.
2) Renaming njs_ret_t to njs_jump_off_t to better reflect its
purpose.
NO functional changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) all source files are moved to src directory.
2) nxt files are renamed with "njs" prefix.
3) some files are renamed to avoid collisions:
nxt_array.c -> njs_arr.c
nxt_array.h -> njs_arr.h
nxt_string.h -> njs_str.h
nxt_time.c -> njs_time.c
nxt_time.h -> njs_time.h
njs_time.c -> njs_timer.c
njs_time.h -> njs_timer.c
njs_core.h -> njs_main.h
4) C tests are moved to src/test dir.
5) Other tests are moved to test dir.
6) Some structs are renamed to avoid collisions:
nxt_array_t -> njs_arr_t
nxt_string_t -> njs_str_t
appropriate functions and macros are also renamed.
7) all macros, functions and other identifiers with "NXT_" and "nxt_"
prefixes are renamed to corresponding "NJS_" or "njs_" prefix.
NO functional changes.
|
|
|
|
| |
Into njs_vm_value_to_string() and njs_vm_backtrace_dump().
|
|
|
|
|
|
|
|
|
|
| |
process object properties:
argv - an array containing the command line arguments
env - an object containing the user environment
pid - process PID
ppid - process parent PID
This closes #84 issue on Github.
|
|
|
|
| |
This closes #173 issue on Github.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
According to ES 5.1:10.5 direct checking of the number
of arguments should be avoided.
|
|
|
|
| |
Instead of empty string.
|
| |
|
|
|
|
| |
This fixes #101 issue on Github.
|
| |
|
|
|
|
| |
This closes #37 issue on Github.
|