Description
The following configuration
$ cat etc/trafficserver/remap.config map http://example.com http://127.0.0.1:8888 \ @plugin=header_rewrite.so @pparam=hdrs.config $ cat etc/trafficserver/hdrs.config cond %{TRUE} cond %{REMAP_PSEUDO_HOOK} set-header Some-Header "some value"
Triggers the following error which does not show what and where the problem is:
20160901.23h17m13s [header_rewrite] Unknown condition: REMAP_PSEUDO_HOOK
I would like to add a check which will prevent the above error and print another error clarifying where and what the problem is, for instance:
20160901.23h17m13s [header_rewrite] cond %{REMAP_PSEUDO_HOOK} should come first in the rule set at hdrs.config:2
Attachments
Issue Links
- links to
Provided a patch which would error like this:
In the following 2 use-cases:
$ sudo cat etc/trafficserver/hdrs.config cond %{TRUE} cond %{REMAP_PSEUDO_HOOK} set-header Some-Header "some value"
$ sudo cat etc/trafficserver/hdrs.config cond %{REMAP_PSEUDO_HOOK} cond %{TRUE} cond %{SEND_RESPONSE_HDR_HOOK} set-header Some-Header "some value"
Also added line numbers to the error messages in RuleSet::add_condition() and RuleSet::add_operator().