From 9f04d6db630a22658581cbe7a9d28ecdb13d8de9 Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Wed, 9 Aug 2023 14:36:16 +0800 Subject: HTTP: stored matched action in nxt_http_request_t. No functional changes. --- src/nxt_http_route.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nxt_http_route.c') diff --git a/src/nxt_http_route.c b/src/nxt_http_route.c index 0935dd4a..8fd6801d 100644 --- a/src/nxt_http_route.c +++ b/src/nxt_http_route.c @@ -1573,6 +1573,11 @@ nxt_http_route_handler(nxt_task_t *task, nxt_http_request_t *r, } if (action != NULL) { + + if (action != NXT_HTTP_ACTION_ERROR) { + r->action = action; + } + return action; } } -- cgit From a28bef097cd63da3bbb375ef0283e65be41a88ff Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Wed, 9 Aug 2023 14:37:16 +0800 Subject: HTTP: controlling response headers support. --- src/nxt_http_route.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nxt_http_route.c') diff --git a/src/nxt_http_route.c b/src/nxt_http_route.c index 8fd6801d..4a64d5c1 100644 --- a/src/nxt_http_route.c +++ b/src/nxt_http_route.c @@ -583,6 +583,11 @@ static nxt_conf_map_t nxt_http_route_action_conf[] = { NXT_CONF_MAP_PTR, offsetof(nxt_http_action_conf_t, rewrite) }, + { + nxt_string("response_headers"), + NXT_CONF_MAP_PTR, + offsetof(nxt_http_action_conf_t, set_headers) + }, { nxt_string("pass"), NXT_CONF_MAP_PTR, @@ -671,6 +676,13 @@ nxt_http_action_init(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, } } + if (acf.set_headers != NULL) { + ret = nxt_http_set_headers_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); } -- cgit