From 49aee6760a26b14c06180e4f25088cb18e2037a7 Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Mon, 11 Dec 2023 10:46:58 +0800 Subject: HTTP: added TSTR validation flag to the rewrite option. This is to improve error messages for rewrite configuration. Take the configuration as an example: { "rewrite": "`${a + " } Previously, when applying it the user would see this error message: failed to apply previous configuration After this change, the user will see this improved error message: the previous configuration is invalid: "SyntaxError: Unexpected end of input in default:1" in the "rewrite" value. --- src/nxt_conf_validation.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nxt_conf_validation.c b/src/nxt_conf_validation.c index f00b28b8..32ed4ffd 100644 --- a/src/nxt_conf_validation.c +++ b/src/nxt_conf_validation.c @@ -690,6 +690,7 @@ static nxt_conf_vldt_object_t nxt_conf_vldt_action_common_members[] = { { .name = nxt_string("rewrite"), .type = NXT_CONF_VLDT_STRING, + .flags = NXT_CONF_VLDT_TSTR, }, { .name = nxt_string("response_headers"), -- cgit