aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_parse.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2024-09-10 16:48:11 +0400
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>2024-09-13 16:47:56 +0400
commit1a64c196a7d43f83a14fec20ce8936e599c92865 (patch)
tree4a04dac2ff955f43e9795ebb152fbc4055a6aacf /src/http/ngx_http_parse.c
parent00637cce366f17b78fe1ed5c1ef0e534143045f6 (diff)
downloadnginx-1a64c196a7d43f83a14fec20ce8936e599c92865.tar.gz
nginx-1a64c196a7d43f83a14fec20ce8936e599c92865.zip
Proxy: proxy_pass_trailers directive.
The directive allows to pass upstream response trailers to client.
Diffstat (limited to 'src/http/ngx_http_parse.c')
-rw-r--r--src/http/ngx_http_parse.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index f7e50388f..a45c04554 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -2140,7 +2140,7 @@ ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args)
ngx_int_t
ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
- ngx_http_chunked_t *ctx)
+ ngx_http_chunked_t *ctx, ngx_uint_t keep_trailers)
{
u_char *pos, ch, c;
ngx_int_t rc;
@@ -2218,6 +2218,9 @@ ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
state = sw_last_chunk_extension_almost_done;
break;
case LF:
+ if (keep_trailers) {
+ goto done;
+ }
state = sw_trailer;
break;
case ';':
@@ -2297,12 +2300,18 @@ ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
state = sw_last_chunk_extension_almost_done;
break;
case LF:
+ if (keep_trailers) {
+ goto done;
+ }
state = sw_trailer;
}
break;
case sw_last_chunk_extension_almost_done:
if (ch == LF) {
+ if (keep_trailers) {
+ goto done;
+ }
state = sw_trailer;
break;
}