]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: No longer rely on deprecated sample fetches for predefined ACLs
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 1 Apr 2021 15:24:04 +0000 (17:24 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 5 Apr 2021 15:21:05 +0000 (17:21 +0200)
Some predefined ACLs were still based on deprecated sample fetches, like
req_proto_http or req_ver. Now, they use non-deprecated sample fetches. In
addition, the usage lines in the configuration manual have been updated to
be more explicit.

doc/configuration.txt
src/acl.c

index 67377198a782c161e0d9515ecadd4950ee08cbeb..c25e2cea2c1645dfd1a1207f95160b057d20d8de 100644 (file)
@@ -19498,29 +19498,29 @@ every frontend which needs them. They all have their names in upper case in
 order to avoid confusion. Their equivalence is provided below.
 
 ACL name          Equivalent to                Usage
----------------+-----------------------------+---------------------------------
-FALSE            always_false                  never match
-HTTP             req_proto_http                match if protocol is valid HTTP
-HTTP_1.0         req_ver 1.0                   match HTTP version 1.0
-HTTP_1.1         req_ver 1.1                   match HTTP version 1.1
-HTTP_CONTENT     hdr_val(content-length) gt 0  match an existing content-length
-HTTP_URL_ABS     url_reg ^[^/:]*://            match absolute URL with scheme
-HTTP_URL_SLASH   url_beg /                     match URL beginning with "/"
-HTTP_URL_STAR    url     *                     match URL equal to "*"
-LOCALHOST        src 127.0.0.1/8               match connection from local host
-METH_CONNECT     method  CONNECT               match HTTP CONNECT method
-METH_DELETE      method  DELETE                match HTTP DELETE method
-METH_GET         method  GET HEAD              match HTTP GET or HEAD method
-METH_HEAD        method  HEAD                  match HTTP HEAD method
-METH_OPTIONS     method  OPTIONS               match HTTP OPTIONS method
-METH_POST        method  POST                  match HTTP POST method
-METH_PUT         method  PUT                   match HTTP PUT method
-METH_TRACE       method  TRACE                 match HTTP TRACE method
-RDP_COOKIE       req_rdp_cookie_cnt gt 0       match presence of an RDP cookie
-REQ_CONTENT      req_len gt 0                  match data in the request buffer
-TRUE             always_true                   always match
-WAIT_END         wait_end                      wait for end of content analysis
----------------+-----------------------------+---------------------------------
+---------------+----------------------------------+------------------------------------------------------
+FALSE            always_false                       never match
+HTTP             req.proto_http                     match if request protocol is valid HTTP
+HTTP_1.0         req.ver 1.0                        match if HTTP request version is 1.0
+HTTP_1.1         req.ver 1.1                        match if HTTP request version is 1.1
+HTTP_CONTENT     req.hdr_val(content-length) gt 0   match an existing content-length in the HTTP request
+HTTP_URL_ABS     url_reg ^[^/:]*://                 match absolute URL with scheme
+HTTP_URL_SLASH   url_beg /                          match URL beginning with "/"
+HTTP_URL_STAR    url     *                          match URL equal to "*"
+LOCALHOST        src 127.0.0.1/8                    match connection from local host
+METH_CONNECT     method  CONNECT                    match HTTP CONNECT method
+METH_DELETE      method  DELETE                     match HTTP DELETE method
+METH_GET         method  GET HEAD                   match HTTP GET or HEAD method
+METH_HEAD        method  HEAD                       match HTTP HEAD method
+METH_OPTIONS     method  OPTIONS                    match HTTP OPTIONS method
+METH_POST        method  POST                       match HTTP POST method
+METH_PUT         method  PUT                        match HTTP PUT method
+METH_TRACE       method  TRACE                      match HTTP TRACE method
+RDP_COOKIE       req.rdp_cookie_cnt gt 0            match presence of an RDP cookie in the request buffer
+REQ_CONTENT      req.len gt 0                       match data in the request buffer
+TRUE             always_true                        always match
+WAIT_END         wait_end                           wait for end of content analysis
+---------------+----------------------------------+------------------------------------------------------
 
 
 8. Logging
index 7801e2e2482e30b6cfadb36191ecab028ba2f802..54324c5a8a633791b215cdb01aa5baa27989c7aa 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -752,9 +752,9 @@ const struct {
        { .name = "TRUE",           .expr = {"always_true",""}},
        { .name = "FALSE",          .expr = {"always_false",""}},
        { .name = "LOCALHOST",      .expr = {"src","127.0.0.1/8",""}},
-       { .name = "HTTP",           .expr = {"req_proto_http",""}},
-       { .name = "HTTP_1.0",       .expr = {"req_ver","1.0",""}},
-       { .name = "HTTP_1.1",       .expr = {"req_ver","1.1",""}},
+       { .name = "HTTP",           .expr = {"req.proto_http",""}},
+       { .name = "HTTP_1.0",       .expr = {"req.ver","1.0",""}},
+       { .name = "HTTP_1.1",       .expr = {"req.ver","1.1",""}},
        { .name = "METH_CONNECT",   .expr = {"method","CONNECT",""}},
        { .name = "METH_DELETE",    .expr = {"method","DELETE",""}},
        { .name = "METH_GET",       .expr = {"method","GET","HEAD",""}},
@@ -766,9 +766,9 @@ const struct {
        { .name = "HTTP_URL_ABS",   .expr = {"url_reg","^[^/:]*://",""}},
        { .name = "HTTP_URL_SLASH", .expr = {"url_beg","/",""}},
        { .name = "HTTP_URL_STAR",  .expr = {"url","*",""}},
-       { .name = "HTTP_CONTENT",   .expr = {"hdr_val(content-length)","gt","0",""}},
-       { .name = "RDP_COOKIE",     .expr = {"req_rdp_cookie_cnt","gt","0",""}},
-       { .name = "REQ_CONTENT",    .expr = {"req_len","gt","0",""}},
+       { .name = "HTTP_CONTENT",   .expr = {"req.hdr_val(content-length)","gt","0",""}},
+       { .name = "RDP_COOKIE",     .expr = {"req.rdp_cookie_cnt","gt","0",""}},
+       { .name = "REQ_CONTENT",    .expr = {"req.len","gt","0",""}},
        { .name = "WAIT_END",       .expr = {"wait_end",""}},
        { .name = NULL, .expr = {""}}
 };