summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2024-06-11 17:59:00 +0800
committerZhidao HONG <z.hong@f5.com>2024-06-20 10:39:55 +0800
commit64f4c78bf441fa9e021d905a03d374d0a9e05e8d (patch)
treee4d12f7eb8a085ae8f58f313a98c761d6594660a /src/nxt_router.c
parentf80a36a60d61ecd5621d33af37aed35fd074f982 (diff)
downloadunit-64f4c78bf441fa9e021d905a03d374d0a9e05e8d.tar.gz
unit-64f4c78bf441fa9e021d905a03d374d0a9e05e8d.tar.bz2
http: Support chunked request bodies
This is a temporary support for chunked request bodies by converting to Content-Length. This allows for processing of such requests until a more permanent solution is developed. A new configuration option "chunked_transform" has been added to enable this feature. The option can be set as follows: { "settings": { "chunked_transform": true } } By default, this option is set to false, which retains the current behaviour of rejecting chunked requests with a '411 Length Required' status code. Please note that this is an experimental implementation. Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 48870d20..43209451 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1575,6 +1575,12 @@ static nxt_conf_map_t nxt_router_http_conf[] = {
NXT_CONF_MAP_INT8,
offsetof(nxt_socket_conf_t, server_version),
},
+
+ {
+ nxt_string("chunked_transform"),
+ NXT_CONF_MAP_INT8,
+ offsetof(nxt_socket_conf_t, chunked_transform),
+ },
};
@@ -1994,6 +2000,7 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
skcf->proxy_read_timeout = 30 * 1000;
skcf->server_version = 1;
+ skcf->chunked_transform = 0;
skcf->websocket_conf.max_frame_size = 1024 * 1024;
skcf->websocket_conf.read_timeout = 60 * 1000;