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_static.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_static.c')
-rw-r--r-- | src/nxt_http_static.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nxt_http_static.c b/src/nxt_http_static.c index 387cdec0..19393f2c 100644 --- a/src/nxt_http_static.c +++ b/src/nxt_http_static.c @@ -79,9 +79,11 @@ nxt_http_static_init(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, nxt_str_t str, *ret; nxt_var_t *var; nxt_conf_value_t *cv; + nxt_router_conf_t *rtcf; nxt_http_static_conf_t *conf; - mp = tmcf->router_conf->mem_pool; + rtcf = tmcf->router_conf; + mp = rtcf->mem_pool; conf = nxt_mp_zget(mp, sizeof(nxt_http_static_conf_t)); if (nxt_slow_path(conf == NULL)) { @@ -102,7 +104,7 @@ nxt_http_static_init(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, cv = nxt_conf_get_array_element_or_itself(acf->share, i); nxt_conf_get_string(cv, &str); - var = nxt_var_compile(&str, mp, 1); + var = nxt_var_compile(&str, mp, rtcf->var_fields, 1); if (nxt_slow_path(var == NULL)) { return NXT_ERROR; } @@ -128,7 +130,7 @@ nxt_http_static_init(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, nxt_str_t chr, shr; nxt_bool_t is_const; - conf->chroot = nxt_var_compile(&acf->chroot, mp, 1); + conf->chroot = nxt_var_compile(&acf->chroot, mp, rtcf->var_fields, 1); if (nxt_slow_path(conf->chroot == NULL)) { return NXT_ERROR; } |