From: Christopher Faulet Date: Thu, 1 Apr 2021 15:24:04 +0000 (+0200) Subject: MINOR: No longer rely on deprecated sample fetches for predefined ACLs X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=584b5ca14d3d73ddf086f9b1a6b70d2d07525257;p=haproxy-2.1.git MINOR: No longer rely on deprecated sample fetches for predefined ACLs 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. (cherry picked from commit 779184e35e4468d86419fb1935ca3491f1081d0b) Signed-off-by: Christopher Faulet (cherry picked from commit 2c9c0c980071b073c605577bbc75cf6119bcba99) Signed-off-by: Christopher Faulet (cherry picked from commit 8a8ef60b0602b41d397a2e7749d6f2dba4b50ce8) Signed-off-by: Christopher Faulet --- diff --git a/doc/configuration.txt b/doc/configuration.txt index ce8abbb..5e1e0f6 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -16442,29 +16442,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 diff --git a/src/acl.c b/src/acl.c index cb2e75f..d510a92 100644 --- a/src/acl.c +++ b/src/acl.c @@ -792,9 +792,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",""}}, @@ -806,9 +806,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 = {""}} };