NJS: variable access support

This commit introduces the 'vars' JavaScript object to NJS,
enabling direct access to native variables such as $uri and $arg_foo.
The syntax is `${vars.var_name}` or `${'vars[var_name]'}`.

For example:
    {
        "action": {
            "share": "`/www/html${vars.uri}`"
        }
    }
This commit is contained in:
Zhidao HONG
2024-01-31 14:51:21 +08:00
parent 63ad4deb8a
commit 33c6c4d4c0
3 changed files with 58 additions and 2 deletions

View File

@@ -65,6 +65,12 @@ conditional access logging.
</para>
</change>
<change type="feature">
<para>
NJS variables access.
</para>
</change>
<change type="feature">
<para>
$request_id variable contains a string that is formed using random data and