diff options
author | Zhidao HONG <z.hong@f5.com> | 2023-12-11 10:46:58 +0800 |
---|---|---|
committer | Zhidao HONG <z.hong@f5.com> | 2023-12-14 16:38:24 +0800 |
commit | 49aee6760a26b14c06180e4f25088cb18e2037a7 (patch) | |
tree | 58dd85784d6d9a002f516073b78f3231397e31a4 | |
parent | 88854cf14688286f835f7177c6bfaa17f1962f67 (diff) | |
download | unit-49aee6760a26b14c06180e4f25088cb18e2037a7.tar.gz unit-49aee6760a26b14c06180e4f25088cb18e2037a7.tar.bz2 |
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.
-rw-r--r-- | src/nxt_conf_validation.c | 1 |
1 files changed, 1 insertions, 0 deletions
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"), |