aboutsummaryrefslogtreecommitdiff
path: root/nginx/t
Commit message (Collapse)AuthorAge
* Fixed NULL pointer dereference when processing If-* headers.Dmitry Volyntsev6 days
| | | | | | | | | | | | Previously, when processing requests with If-Match and If-Unmodified-Since headers worker process crashed. For example with the following code: try { r.return(200) } catch (e) { r.internalRedirect() } The fix is to disable not_modified filter as it was done in nginx perl module nginx/nginx@d9887ee2.
* Fetch: fixed handling of Content-Length header when body is provided.Dmitry Volyntsev2025-06-18
| | | | | | | | | | | | | | | | | | | | | | body value length takes precedence over Content-Length from header list. https://fetch.spec.whatwg.org/#http-network-or-cache-fetch Let contentLength be httpRequest’s body’s length, if httpRequest’s body is non-null; otherwise null. Let contentLengthHeaderValue be null. If httpRequest’s body is null and httpRequest’s method is `POST` or `PUT`, then set contentLengthHeaderValue to `0`. If contentLength is non-null, then set contentLengthHeaderValue to contentLength, serialized and isomorphic encoded. If contentLengthHeaderValue is non-null, then append (`Content-Length`, contentLengthHeaderValue) to httpRequest’s header list. This fixes #930 issue in Github.
* Tests: tuned periodic test for delays.Dmitry Volyntsev2025-06-13
|
* Modules: added state file for the shared dictionary.Dmitry Volyntsev2025-05-22
| | | | | | | | | A new optional state parameter is added for js_shared_dict_zone directive. state parameter specifies a file that keeps the current state of the shared dict in the JSON format and makes it persistent across nginx restarts. This closes #709 feature request on Github.
* Tests: removed leftover engine checks.Dmitry Volyntsev2025-05-22
|
* Fetch: QuickJS support.Zhidao HONG2025-05-09
|
* Tests: fixed js_body_filter.t.Dmitry Volyntsev2025-05-01
| | | | | | The 1496ed3f commit made visible a problem with the fragile filter tests which depend on the exact sequence of data chunks. The fix is to use perl http server to ensure the order.
* Tests: improved js_body_filter.t tests.Dmitry Volyntsev2025-04-29
| | | | | | Dropping Content-Length header in locations where response body length is modified. This is not strictly needed for the test itself, but can serve as an example for a typical body modification task.
* Tests: fixed js_body_filter.t tests.Dmitry Volyntsev2025-04-29
| | | | Previously, '|' was used incorrectly in test match pattern.
* Fetch: accepting response headers with underscore characters.Dmitry Volyntsev2025-02-24
| | | | This fixes #856 on Github.
* Tests: making fetch test portable by removing njs.dump().Dmitry Volyntsev2025-02-24
|
* Modules: improved reporting of unhandled promise rejections.Dmitry Volyntsev2025-02-24
| | | | | | | | | | | | | | | | | | | Previously, some promise rejections were not reported. For example: async function timeout(ms) { return new Promise((resolve, reject) => { setTimeout(() => { reject(new Error('timeout')); }, ms); }); } async function handler(r) { let v = await timeout(1000); r.return(200); }
* Tests: splitting js_periodic tests into multiple files.Dmitry Volyntsev2025-02-20
|
* Modules: fixed name corruption in variable and header processing.Dmitry Volyntsev2025-02-10
| | | | | | | | | The HTTP and Stream JS modules were performing in-place lowercasing of variable and header names, which could inadvertently overwrite the original data. In the NJS engine, the problem did not manifest itself for strings up to 14 bytes long because they are inlined into the value.
* HTTP: reading r.requestText or r.requestBuffer from a temp file.Dmitry Volyntsev2025-01-31
| | | | | | Previously, an exception was thrown when accessing r.requestText or r.requestBuffer if a client request body size exceeded client_body_buffer_size.
* QuickJS: added WebCrypto module.Dmitry Volyntsev2025-01-24
|
* Tests: moving request body tests to js_request_body.t.Dmitry Volyntsev2025-01-22
|
* Tests: added request body test when body is in a file.Dmitry Volyntsev2025-01-22
|
* Modules: removed extra VM creation per server.Dmitry Volyntsev2025-01-06
| | | | | | | | | | Previously, when js_import was declared in http or stream blocks, an extra copy of the VM instance was created for each server block. This was not needed and consumed a lot of memory for configurations with many server blocks. This issue was introduced in 9b674412 (0.8.6) and was partially fixed for location blocks only in 685b64f0 (0.8.7).
* Tests: skipping stream_js_periodic.t for QuickJS engine.Dmitry Volyntsev2024-12-18
|
* HTTP: fixed limit rated output.Dmitry Volyntsev2024-11-27
| | | | | | Previously, when r.return(code, body) was called from a subrequest handler with a body size larger than the sendfile_max_chunk value connection hanging might occur.
* Modules: fixed process.env object.Dmitry Volyntsev2024-11-06
| | | | | Previously, it ignored changes to environment variables introduced with "env" directive.
* Modules: added js_shared_dict_zone support in QuickJS engine.Dmitry Volyntsev2024-10-30
|
* Tests: removed njs specific code from js_shared_dict.t.Dmitry Volyntsev2024-10-30
|
* Tests: added js_body_filter test with non-UTF8 data.Dmitry Volyntsev2024-10-17
| | | | To test for implicit UTF8 conversion.
* HTTP: fixed r.return() with empty string as a body argument.Dmitry Volyntsev2024-09-25
|
* Modules: introduced QuickJS engine.Dmitry Volyntsev2024-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | "js_engine" directive is introduced which sets JavaScript engine. When the module is built with QuickJS library "js_engine qjs;" sets QuickJS engine for the current block. By default njs engine is used. For example, nginx.conf: location /a { js_engine qjs; # will be handled by QuickJS js_content main.handler; } location /b { # will be handled by njs js_content main.handler; } QuickJS engine implements drop-in replacement for nginx/njs objects with the following exceptions: * nginx module API to be added later: ngx.fetch(), ngx.shared.dict. * Built-in modules to be added later: fs, crypto, WebCrypto, xml. * NJS specific API: njs.dump(), njs.on(), console.dump(). * js_preload_object directive.
* Tests: making exception test more portable in stream_js.t.Dmitry Volyntsev2024-09-03
|
* Modules: added nocache flag for js_set variables.Thomas P.2024-08-23
| | | | | | | | | | This commit adds support for an additional `nocache` flag in `js_set` directives. If set, the resulting nginx variable will have no_cacheable set to 1. This enables us to dynamically recompute a variable if the context changed (for example, in case of an internal redirection). In case of multiple calls in a location, users should cache the result in a rewrite variable: `set $cached_variable $js_variable;`
* HTTP: expose capture group variables.Thomas P.2024-08-15
|
* Tests: adapting unsafe redirect test for QuickJS.Dmitry Volyntsev2024-07-25
| | | | | | | At the moment QuickJS has no API for getting strings with NUL characters in the middle of the string. Instead of a NUL byte make another unsafe redirect URI.
* Tests: making exception test more portable in js.t.Dmitry Volyntsev2024-07-25
|
* Tests: removed njs specific code from js_headers.t.Dmitry Volyntsev2024-07-18
|
* Tests: ignoring subrequest execution order in js_subrequest.t.Dmitry Volyntsev2024-07-18
|
* HTTP: simplified check for subrequest from a subrequest.Dmitry Volyntsev2024-06-28
|
* HTTP: fixed r.subrequest() error handling.Dmitry Volyntsev2024-06-12
| | | | | | | | | | Previously, when at least 2 subrequests were scheduled they both succeed, but the callback for the second threw an exception heap-use-after-free happened: a nested chain of ngx_http_run_posted_requests() calls and terminating request in the inner call left outer calls with already freed request pointer. The issue was introduced in 0.8.1 (4cb8e873e8c6).
* Modules: shared dictionary add, set, incr methods timeout argument.jo-carter2024-06-10
| | | | | | | | | The optional timeout argument overrides the timeout specified with the shared_dict_zone directive for the effected key and operation only. The timeout is specified in milliseconds. This is useful when the majority of keys are expected to require unique timeouts.
* Tests: compatibility with "openssl" app from OpenSSL 3.2.0.Dmitry Volyntsev2024-06-10
|
* Tests: fixed typo in stream_js_dup_set.t introduced in be271e8d0b3b.Dmitry Volyntsev2024-04-26
| | | | Previously, with typo the test was always skipped.
* Fetch: fixed request Host header when the port is non-standard.Dmitry Volyntsev2024-04-26
| | | | This fixes #707 issue on Github.
* Modules: improved checking for duplicate js_set variables.Dmitry Volyntsev2024-04-22
| | | | | | | | | | | Since 6fb1aca4eeaf (0.8.4) the identical js_set variables introduced as a part of an include file that is shared amongst multiple vhosts are rejected during configuration parsing. The patch ignores duplicate js_set variables when they refer to the same JS function. This fixes #705 issue on Github.
* HTTP: fixed r.send() with Buffer argument.Dmitry Volyntsev2024-04-08
| | | | | | Previously, only string value type was accepted. This closes #701 issue on Github.
* HTTP: validating URI and args arguments in r.subrequest().Dmitry Volyntsev2024-04-02
|
* Tests: adapt stream_js.t to nginx changes.Dmitry Volyntsev2024-04-01
| | | | | | | | | Make the test more robust against changes in nginx, specifically cf890df37bb6 (Stream: socket peek in preread phase). The filter callbacks may be called multiple times by nginx and the exact number is not specified. The new test avoids relying on the exact number of calls from nginx.
* Tests: adapt stream_js_preload_object.t to nginx changes.Dmitry Volyntsev2024-04-01
| | | | | | | | | Make the test more robust against changes in nginx, specifically cf890df37bb6 (Stream: socket peek in preread phase). The filter callbacks may be called multiple times by nginx and the exact number is not specified. The new test avoids relying on the exact number of calls from nginx.
* Tests: simplified stream_js_import2.t.Dmitry Volyntsev2024-04-01
| | | | | The test should only verify js_import directive in server context according to its description.
* Tests: removed stream_js_import.t.Dmitry Volyntsev2024-04-01
| | | | | js_import is the only directive to load JS code since 0.7.1, so the test is redundant.
* Modules: fixed clear() method of a shared dictionary without timeout.Dmitry Volyntsev2024-03-19
| | | | | | | | Previously, the code did not unlock the rwlock when a dict was empty. The issue was introduced in 4a15613f4e8b (0.8.3). This closes issue #699 on Github.
* HTTP: allowing to set Server header.Dmitry Volyntsev2024-02-29
|
* Reverted changes introduced in 7eaaa7d57636 (not released) back.Dmitry Volyntsev2024-02-06
| | | | Relative importing is again supported.