Willy Tarreau | 1d7ca2e | 2013-12-13 01:32:09 +0100 | [diff] [blame] | 1 | # This config file aims to trigger all error detection cases in the ACL |
| 2 | # expression parser related to the fetch arguments. |
| 3 | |
| 4 | # silence some warnings |
| 5 | defaults |
| 6 | mode http |
| 7 | timeout client 1s |
| 8 | timeout server 1s |
| 9 | timeout connect 1s |
| 10 | |
| 11 | frontend 1 |
| 12 | bind :10000 |
| 13 | |
| 14 | # missing fetch method in ACL expression '(arg)'. |
Willy Tarreau | d4359fd | 2021-04-02 10:49:34 +0200 | [diff] [blame] | 15 | http-request deny if { (arg) } |
Willy Tarreau | 1d7ca2e | 2013-12-13 01:32:09 +0100 | [diff] [blame] | 16 | |
| 17 | # unknown fetch method 'blah' in ACL expression 'blah(arg)'. |
Willy Tarreau | d4359fd | 2021-04-02 10:49:34 +0200 | [diff] [blame] | 18 | http-request deny if { blah(arg) } |
Willy Tarreau | 1d7ca2e | 2013-12-13 01:32:09 +0100 | [diff] [blame] | 19 | |
| 20 | # missing closing ')' after arguments to fetch keyword 'req.hdr' in ACL expression 'req.hdr('. |
Willy Tarreau | d4359fd | 2021-04-02 10:49:34 +0200 | [diff] [blame] | 21 | http-request deny if { req.hdr( } |
Willy Tarreau | 1d7ca2e | 2013-12-13 01:32:09 +0100 | [diff] [blame] | 22 | |
Ilya Shipitsin | d425950 | 2020-04-08 01:07:56 +0500 | [diff] [blame] | 23 | # cannot be triggered : "returns type of fetch method '%s' is unknown" |
Willy Tarreau | 1d7ca2e | 2013-12-13 01:32:09 +0100 | [diff] [blame] | 24 | |
| 25 | # fetch method 'always_true' : no argument supported, but got 'arg' in ACL expression 'always_true(arg)'. |
Willy Tarreau | d4359fd | 2021-04-02 10:49:34 +0200 | [diff] [blame] | 26 | http-request deny if { always_true(arg) } |
Willy Tarreau | 1d7ca2e | 2013-12-13 01:32:09 +0100 | [diff] [blame] | 27 | |
| 28 | # fetch method 'req.hdr' : failed to parse 'a' as type 'signed integer' at position 2 in ACL expression 'req.hdr(a,a)'. |
Willy Tarreau | d4359fd | 2021-04-02 10:49:34 +0200 | [diff] [blame] | 29 | http-request deny if { req.hdr(a,a) } |
Willy Tarreau | 1d7ca2e | 2013-12-13 01:32:09 +0100 | [diff] [blame] | 30 | |
| 31 | # in argument to 'payload_lv', payload length must be > 0. |
Willy Tarreau | d4359fd | 2021-04-02 10:49:34 +0200 | [diff] [blame] | 32 | http-request deny if { payload_lv(0,0) } |
Willy Tarreau | 1d7ca2e | 2013-12-13 01:32:09 +0100 | [diff] [blame] | 33 | |
| 34 | # ACL keyword 'payload_lv' : expected type 'unsigned integer' at position 1, but got nothing. |
Willy Tarreau | d4359fd | 2021-04-02 10:49:34 +0200 | [diff] [blame] | 35 | http-request deny if { payload_lv } |
Willy Tarreau | 1d7ca2e | 2013-12-13 01:32:09 +0100 | [diff] [blame] | 36 | |