aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_grpc_module.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2022-05-30 21:25:48 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2022-05-30 21:25:48 +0300
commitd22157fade0c3dc05b860be8d7e3eff4a56cb7d3 (patch)
tree61d9ccdee35fca145d8290e8aee8ea45603c3e19 /src/http/modules/ngx_http_grpc_module.c
parent268f0cba8887ba77b6a2c97a8732df2784fe6001 (diff)
downloadnginx-d22157fade0c3dc05b860be8d7e3eff4a56cb7d3.tar.gz
nginx-d22157fade0c3dc05b860be8d7e3eff4a56cb7d3.zip
Upstream: header handlers can now return parsing errors.
With this change, duplicate Content-Length and Transfer-Encoding headers are now rejected. Further, responses with invalid Content-Length or Transfer-Encoding headers are now rejected, as well as responses with both Content-Length and Transfer-Encoding.
Diffstat (limited to 'src/http/modules/ngx_http_grpc_module.c')
-rw-r--r--src/http/modules/ngx_http_grpc_module.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_grpc_module.c b/src/http/modules/ngx_http_grpc_module.c
index 864fc4fda..a64658f72 100644
--- a/src/http/modules/ngx_http_grpc_module.c
+++ b/src/http/modules/ngx_http_grpc_module.c
@@ -1891,8 +1891,12 @@ ngx_http_grpc_process_header(ngx_http_request_t *r)
hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
h->lowcase_key, h->key.len);
- if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {
- return NGX_ERROR;
+ if (hh) {
+ rc = hh->handler(r, h, hh->offset);
+
+ if (rc != NGX_OK) {
+ return rc;
+ }
}
continue;