Commit 504fda6
committed
Modules: js_set inline JavaScript expressions.
Added support for inline JavaScript expressions in the js_set directive.
Previously, js_set only accepted function references:
js_set $var main.handler;
Now it also accepts inline expressions:
js_set $var '(r.uri)';
js_set $var 'r.headersIn["Host"] || "none"';
Additionally, nginx-style $variable references are expanded to
the corresponding JavaScript variable access. For example:
js_set $var '$uri.toUpperCase()';
is equivalent to:
js_set $var 'r.variables.uri.toUpperCase()';
In stream context, $var expands to s.variables.var.
The expansion is a textual substitution at configuration parse time
for $name patterns where name starts with [A-Za-z_].1 parent 1dbce7d commit 504fda6
File tree
8 files changed
+769
-76
lines changed- nginx
- t
8 files changed
+769
-76
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1620 | 1620 | | |
1621 | 1621 | | |
1622 | 1622 | | |
1623 | | - | |
1624 | | - | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
1625 | 1626 | | |
1626 | 1627 | | |
1627 | 1628 | | |
| |||
8016 | 8017 | | |
8017 | 8018 | | |
8018 | 8019 | | |
8019 | | - | |
8020 | | - | |
8021 | | - | |
| 8020 | + | |
| 8021 | + | |
| 8022 | + | |
| 8023 | + | |
| 8024 | + | |
| 8025 | + | |
8022 | 8026 | | |
8023 | 8027 | | |
8024 | 8028 | | |
| |||
8041 | 8045 | | |
8042 | 8046 | | |
8043 | 8047 | | |
8044 | | - | |
8045 | | - | |
8046 | | - | |
8047 | | - | |
| 8048 | + | |
| 8049 | + | |
| 8050 | + | |
| 8051 | + | |
| 8052 | + | |
| 8053 | + | |
| 8054 | + | |
| 8055 | + | |
8048 | 8056 | | |
8049 | 8057 | | |
8050 | 8058 | | |
8051 | 8059 | | |
8052 | 8060 | | |
8053 | | - | |
| 8061 | + | |
| 8062 | + | |
8054 | 8063 | | |
8055 | 8064 | | |
8056 | 8065 | | |
8057 | | - | |
| 8066 | + | |
8058 | 8067 | | |
8059 | 8068 | | |
8060 | 8069 | | |
| |||
0 commit comments