| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Previously, '|' was used incorrectly in test match pattern.
|
|
|
|
| |
This fixes #856 on Github.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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);
}
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Previously, an exception was thrown when accessing r.requestText or
r.requestBuffer if a client request body size exceeded
client_body_buffer_size.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Previously, it ignored changes to environment variables introduced
with "env" directive.
|
| |
|
| |
|
|
|
|
| |
To test for implicit UTF8 conversion.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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;`
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Previously, with typo the test was always skipped.
|
|
|
|
| |
This fixes #707 issue on Github.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Previously, only string value type was accepted.
This closes #701 issue on Github.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The test should only verify js_import directive in server context
according to its description.
|
|
|
|
|
| |
js_import is the only directive to load JS code since 0.7.1, so the test is
redundant.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Relative importing is again supported.
|