comparison src/http/ngx_http_variables.h @ 8023:08b3ea81ff5f

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).
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 30 May 2022 21:25:32 +0300
parents 2a288909abc6
children
comparison
equal deleted inserted replaced
8022:8b7a96fdd54c 8023:08b3ea81ff5f
55 ngx_uint_t index); 55 ngx_uint_t index);
56 56
57 ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r, 57 ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r,
58 ngx_str_t *name, ngx_uint_t key); 58 ngx_str_t *name, ngx_uint_t key);
59 59
60 ngx_int_t ngx_http_variable_unknown_header(ngx_http_variable_value_t *v, 60 ngx_int_t ngx_http_variable_unknown_header(ngx_http_request_t *r,
61 ngx_str_t *var, ngx_list_part_t *part, size_t prefix); 61 ngx_http_variable_value_t *v, ngx_str_t *var, ngx_list_part_t *part,
62 size_t prefix);
62 63
63 64
64 #if (NGX_PCRE) 65 #if (NGX_PCRE)
65 66
66 typedef struct { 67 typedef struct {