summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2022-05-30 21:25:32 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2022-05-30 21:25:32 +0300
commit7dc6f4e25d21588249691aab8c6013c126eae258 (patch)
treed17f5b0dac07c8ac5d64d8fb32c574915012b12a /src/http/ngx_http_upstream.c
parent321ff71a6c3d3bd9cbc7a348a0cac26158590f10 (diff)
downloadnginx-7dc6f4e25d21588249691aab8c6013c126eae258.tar.gz
nginx-7dc6f4e25d21588249691aab8c6013c126eae258.tar.bz2
Combining unknown headers during variables lookup (ticket #1316).
Previously, $http_*, $sent_http_*, $sent_trailer_*, $upstream_http_*, and $upstream_trailer_* variables returned only the first header (with a few specially handled exceptions: $http_cookie, $http_x_forwarded_for, $sent_http_cache_control, $sent_http_link). With this change, all headers are returned, combined together. For example, $http_foo variable will be "a, b" if there are "Foo: a" and "Foo: b" headers in the request. Note that $upstream_http_set_cookie will also return all "Set-Cookie" headers (ticket #1843), though this might not be what one want, since the "Set-Cookie" header does not follow the list syntax (see RFC 7230, section 3.2.2).
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index ded833c41..46fde8396 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -5703,7 +5703,7 @@ ngx_http_upstream_header_variable(ngx_http_request_t *r,
return NGX_OK;
}
- return ngx_http_variable_unknown_header(v, (ngx_str_t *) data,
+ return ngx_http_variable_unknown_header(r, v, (ngx_str_t *) data,
&r->upstream->headers_in.headers.part,
sizeof("upstream_http_") - 1);
}
@@ -5718,7 +5718,7 @@ ngx_http_upstream_trailer_variable(ngx_http_request_t *r,
return NGX_OK;
}
- return ngx_http_variable_unknown_header(v, (ngx_str_t *) data,
+ return ngx_http_variable_unknown_header(r, v, (ngx_str_t *) data,
&r->upstream->headers_in.trailers.part,
sizeof("upstream_trailer_") - 1);
}