diff options
| author | Zhidao HONG <z.hong@f5.com> | 2022-07-14 04:32:49 +0800 |
|---|---|---|
| committer | Zhidao HONG <z.hong@f5.com> | 2022-07-14 04:32:49 +0800 |
| commit | 45b89e32577eef18e473d0c7ae24562e7efedcc0 (patch) | |
| tree | d7058ec9ad0fb257897873cc1429182425d17b9b /src/nxt_http_return.c | |
| parent | 7b80186f097fda3d1c0758a30efa889ec89c5a9d (diff) | |
| download | unit-45b89e32577eef18e473d0c7ae24562e7efedcc0.tar.gz unit-45b89e32577eef18e473d0c7ae24562e7efedcc0.tar.bz2 | |
Var: dynamic variables support.
This commit adds the variables $arg_NAME, $header_NAME, and $cookie_NAME.
Diffstat (limited to 'src/nxt_http_return.c')
| -rw-r--r-- | src/nxt_http_return.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nxt_http_return.c b/src/nxt_http_return.c index 82c91568..9f3c4fc5 100644 --- a/src/nxt_http_return.c +++ b/src/nxt_http_return.c @@ -32,12 +32,15 @@ static const nxt_http_request_state_t nxt_http_return_send_state; nxt_int_t -nxt_http_return_init(nxt_mp_t *mp, nxt_http_action_t *action, +nxt_http_return_init(nxt_router_conf_t *rtcf, nxt_http_action_t *action, nxt_http_action_conf_t *acf) { + nxt_mp_t *mp; nxt_str_t str; nxt_http_return_conf_t *conf; + mp = rtcf->mem_pool; + conf = nxt_mp_zget(mp, sizeof(nxt_http_return_conf_t)); if (nxt_slow_path(conf == NULL)) { return NXT_ERROR; @@ -54,7 +57,7 @@ nxt_http_return_init(nxt_mp_t *mp, nxt_http_action_t *action, nxt_conf_get_string(acf->location, &str); - conf->location = nxt_var_compile(&str, mp, 0); + conf->location = nxt_var_compile(&str, mp, rtcf->var_fields, 0); if (nxt_slow_path(conf->location == NULL)) { return NXT_ERROR; } |
