diff options
author | Alejandro Colomar <alx@nginx.com> | 2023-07-19 14:22:21 +0200 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2023-10-25 13:37:58 +0200 |
commit | fd4f4e4c5943c3bcd09e3bdcbeefc263aa2f1937 (patch) | |
tree | 5c91e83b03f5dd9b975fadfa2cb2cf6e03b653a2 /src/nxt_http_route.c | |
parent | ddb7d61f6173c2f191f4eddc15f1f912e940e42c (diff) | |
download | unit-fd4f4e4c5943c3bcd09e3bdcbeefc263aa2f1937.tar.gz unit-fd4f4e4c5943c3bcd09e3bdcbeefc263aa2f1937.tar.bz2 |
HTTP: compress: added "compress" action.
There are still no supported encodings. This is just infrastructure for
the next commits, which will add gzip compression.
Signed-off-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'src/nxt_http_route.c')
-rw-r--r-- | src/nxt_http_route.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nxt_http_route.c b/src/nxt_http_route.c index 4a64d5c1..523dda40 100644 --- a/src/nxt_http_route.c +++ b/src/nxt_http_route.c @@ -9,6 +9,7 @@ #include <nxt_sockaddr.h> #include <nxt_http_route_addr.h> #include <nxt_regex.h> +#include "nxt_http_compress.h" typedef enum { @@ -589,6 +590,11 @@ static nxt_conf_map_t nxt_http_route_action_conf[] = { offsetof(nxt_http_action_conf_t, set_headers) }, { + nxt_string("compress"), + NXT_CONF_MAP_PTR, + offsetof(nxt_http_action_conf_t, compress) + }, + { nxt_string("pass"), NXT_CONF_MAP_PTR, offsetof(nxt_http_action_conf_t, pass) @@ -683,6 +689,13 @@ nxt_http_action_init(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, } } + if (acf.compress != NULL) { + ret = nxt_http_compress_init(rtcf, action, &acf); + if (nxt_slow_path(ret != NXT_OK)) { + return ret; + } + } + if (acf.ret != NULL) { return nxt_http_return_init(rtcf, action, &acf); } |