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.
This commit is contained in:
@@ -690,6 +690,7 @@ static nxt_conf_vldt_object_t nxt_conf_vldt_action_common_members[] = {
|
|||||||
{
|
{
|
||||||
.name = nxt_string("rewrite"),
|
.name = nxt_string("rewrite"),
|
||||||
.type = NXT_CONF_VLDT_STRING,
|
.type = NXT_CONF_VLDT_STRING,
|
||||||
|
.flags = NXT_CONF_VLDT_TSTR,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = nxt_string("response_headers"),
|
.name = nxt_string("response_headers"),
|
||||||
|
|||||||
Reference in New Issue
Block a user