aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_http_js_module.c
Commit message (Collapse)AuthorAge
...
* HTTP: added js body filter.Dmitry Volyntsev2021-02-18
|
* Allowing to pass arbitrary number of arguments in ngx_js_call().Dmitry Volyntsev2021-02-11
|
* HTTP: added js header filter.Dmitry Volyntsev2021-02-01
|
* Modules: added ngx.fetch().Dmitry Volyntsev2021-01-21
| | | | | | | | | | | | | | | | | | | | 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).
* Refactored working with external prototypes.Dmitry Volyntsev2020-12-24
| | | | | | | | | | | | 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.
* HTTP: renaming reqBody,resBody to requestBuffer and responseBuffer.Dmitry Volyntsev2020-11-27
| | | | | | | | | 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.
* Modules: renaming vars to rawVariables to better reflect purpose.Dmitry Volyntsev2020-11-26
| | | | | | | | | | 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.
* Modules: introduced Buffer alternatives for object properties.Dmitry Volyntsev2020-11-25
| | | | | | | | | | | | | | | | | | | | | | 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).
* HTTP: fixed promise subrequest() with error_page redirect.Dmitry Volyntsev2020-11-18
| | | | | | | | | | | 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).
* Modules: added support for Buffer object where string is expected.Dmitry Volyntsev2020-11-17
|
* Modules: introduced global "ngx" object.Dmitry Volyntsev2020-10-02
|
* Introduced a library of common functionality for the modules.Dmitry Volyntsev2020-11-10
|
* Promise: tracking unhandled promise rejection.Alexander Borisov2020-11-03
| | | | | | | | 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.
* HTTP: throwing an exception in internalRedirect() for a subrequest.Alexander Borisov2020-10-08
| | | | This closes #214 issue on GitHub.
* HTTP: added support for http/2 and http/3 in r.httpVersion.Dmitry Volyntsev2020-09-11
|
* HTTP: fixed location merge.Dmitry Volyntsev2020-08-17
|
* HTTP: removed dead store assignment after 3df09cf5345c.Dmitry Volyntsev2020-07-08
|
* HTTP: introduced raw headers API.Dmitry Volyntsev2020-05-08
| | | | | | | | | | 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.
* Modules: setting retval to undefined for functions returning nothing.Dmitry Volyntsev2020-04-30
| | | | This fixes #305 issue on Github.
* HTTP: simplifed headers handling.Dmitry Volyntsev2020-04-30
|
* HTTP: improved getting of multi-valued headers in r.headersIn.Dmitry Volyntsev2020-04-29
| | | | | | | 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 ','.
* HTTP: added support for multi-valued headers in r.headersOut.Dmitry Volyntsev2020-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* HTTP: improved iteration over header objects with duplicates.Dmitry Volyntsev2020-04-21
| | | | | In 9e327cd3a33e duplicates were filtered out only for Cookie and X-Forwarded-For.
* HTTP: improved iteration over r.headersOut with special headers.Dmitry Volyntsev2020-04-21
| | | | | | In f6234460852a getting of special headers "Content-Type" and "Content-Length" was introduced. Still these headers were invisible during iteration over r.headersOut object.
* Modules: added js_import directive.Dmitry Volyntsev2020-04-14
|
* Introduced njs_vm_opt_init().Dmitry Volyntsev2020-04-12
|
* Added API for working with arrays.Dmitry Volyntsev2020-04-03
|
* HTTP: returning undefined value when "responseBody" is unavailable.Dmitry Volyntsev2020-03-20
| | | | Missed in b758915e2406.
* Refactored externals.Dmitry Volyntsev2020-03-20
| | | | This closes #16 issue on Github.
* HTTP: introduced detached subrequest mode in r.subrequest().Dmitry Volyntsev2020-03-02
| | | | | | | | 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.
* HTTP: introduced promise support in r.subrequest().Dmitry Volyntsev2020-01-16
| | | | | If callback is not provided r.subrequest() returns an ordinary Promise object that resolves to subrequest response object.
* HTTP: improved r.parent property handler.Dmitry Volyntsev2019-11-25
| | | | | | | | | 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.
* Style.Dmitry Volyntsev2019-11-08
|
* Refactoring iteration over external objects.Dmitry Volyntsev2019-10-23
| | | | | | | Previously, two callbacks were required to support array-like iteration for external objects (foreach, next). Instead using only one callback (keys) to simplify.
* HTTP: improved getting of special headers from r.headersIn.Dmitry Volyntsev2019-10-15
| | | | | | | If multiple "Cookie" or "X-Forwarded-For" are present they are combined into a single return value. This closes #201 issue on Github.
* Avoiding excessive (njs_value_t *) casts.Dmitry Volyntsev2019-08-01
| | | | | | | | 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.
* Refactored usage of njs_ret_t.Dmitry Volyntsev2019-07-30
| | | | | | | | | | | | | | 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.
* Refactored file hierarchy.Dmitry Volyntsev2019-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Splitting njs_vm_value_to_ext_string().hongzhidao2019-07-02
| | | | Into njs_vm_value_to_string() and njs_vm_backtrace_dump().
* Added process global object.Dmitry Volyntsev2019-06-18
| | | | | | | | | | 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.
* HTTP: support for null as a second argument of r.subrequest().Dmitry Volyntsev2019-06-04
| | | | This closes #173 issue on Github.
* HTTP: improved working with unknown methods in subrequest().Dmitry Volyntsev2019-05-28
|
* HTTP: improved getting of special response headers.Dmitry Volyntsev2019-05-28
|
* Modules: added js_path directive.Dmitry Volyntsev2019-03-26
|
* Modules: improved working with arguments.Dmitry Volyntsev2019-03-26
| | | | | According to ES 5.1:10.5 direct checking of the number of arguments should be avoided.
* Modules: returning undefined value for absent values.Dmitry Volyntsev2019-03-26
| | | | Instead of empty string.
* HTTP: handling absence of value while iterating over r.args.Dmitry Volyntsev2019-03-20
|
* HTTP: avoid creating empty request_body buffer in r.subrequest().Dmitry Volyntsev2019-02-26
| | | | This fixes #101 issue on Github.
* HTTP: setting exception if memory allocation fails.Dmitry Volyntsev2019-02-25
|
* Added support for setting nginx variables.Dmitry Volyntsev2019-02-21
| | | | This closes #37 issue on Github.