aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_variables.c
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2014-04-29 12:28:41 +0400
committerVladimir Homutov <vl@nginx.com>2014-04-29 12:28:41 +0400
commited6780aaf12e99cce0fa3b27fff229b87aefec16 (patch)
tree9b9cef3fe01e83abdb0c4dee788d4b9330ba124b /src/http/ngx_http_variables.c
parentb53306815ecb226c6ae0dd9729a7a0af0043b4d4 (diff)
downloadnginx-ed6780aaf12e99cce0fa3b27fff229b87aefec16.tar.gz
nginx-ed6780aaf12e99cce0fa3b27fff229b87aefec16.zip
Upstream: added the "$upstream_cookie_<name>" variables.
Diffstat (limited to 'src/http/ngx_http_variables.c')
-rw-r--r--src/http/ngx_http_variables.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c
index f61862297..5bd6b96bd 100644
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -613,6 +613,17 @@ ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key)
return NULL;
}
+ if (ngx_strncmp(name->data, "upstream_cookie_", 16) == 0) {
+
+ if (ngx_http_upstream_cookie_variable(r, vv, (uintptr_t) name)
+ == NGX_OK)
+ {
+ return vv;
+ }
+
+ return NULL;
+ }
+
if (ngx_strncmp(name->data, "arg_", 4) == 0) {
if (ngx_http_variable_argument(r, vv, (uintptr_t) name) == NGX_OK) {
@@ -2528,6 +2539,14 @@ ngx_http_variables_init_vars(ngx_conf_t *cf)
continue;
}
+ if (ngx_strncmp(v[i].name.data, "upstream_cookie_", 16) == 0) {
+ v[i].get_handler = ngx_http_upstream_cookie_variable;
+ v[i].data = (uintptr_t) &v[i].name;
+ v[i].flags = NGX_HTTP_VAR_NOCACHEABLE;
+
+ continue;
+ }
+
if (ngx_strncmp(v[i].name.data, "arg_", 4) == 0) {
v[i].get_handler = ngx_http_variable_argument;
v[i].data = (uintptr_t) &v[i].name;