Skip to content

Commit

Permalink
HTTP: added TSTR validation flag to the rewrite option.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hongzhidao committed Dec 14, 2023
1 parent 88854cf commit 49aee67
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/nxt_conf_validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 49aee67

Please sign in to comment.