]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http: add new direction-explicit sample fetches for headers and cookies
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Jan 2013 14:56:36 +0000 (15:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Apr 2013 00:12:59 +0000 (02:12 +0200)
Since "hdr" and "cookie" were ambiguously referring to the request or response
depending on the context, we need a way to explicitly specify the direction.
By prefixing the fetches names with "req." and "res.", we can now restrict such
fetches to the appropriate direction. At the moment the fetches are explicitly
declared by later we might think about having an automatic match when "req." or
"res." appears. These explicit fetches are now used by the relevant ACLs.

doc/configuration.txt
src/proto_http.c

index d15df49071e2d643da620439f2c364ef3a82f011..637d4cba5d543ac9a9bb0cce8a18434fa81558d5 100644 (file)
@@ -9613,10 +9613,7 @@ The list of currently supported pattern fetch functions is the following :
                keyword description for more information on possible caveats.
 
   cook([<name>])
-               This extracts the last occurrence of the cookie name <name> on a
-               "Cookie" header line from the request, and returns its value as
-               string. If no name is specified, the first cookie value is
-               returned.
+               This is an alias for "req.cook".
 
   cookie([<name>])
                This extracts the last occurrence of the cookie name <name> on a
@@ -9631,15 +9628,10 @@ The list of currently supported pattern fetch functions is the following :
                See also : "appsession"
 
   cook_cnt([<name>])
-               Returns an integer value representing the number of occurrences of
-               the cookie <name> in the request, or all cookies if <name> is not
-               specified.
+               This is an alias for "req.cook_cnt".
 
   cook_val([<name>])
-               This extracts the last occurrence of the cookie name <name> on a
-               "Cookie" header line from the request, and converts its value to
-               an integer which is returned. If no name is specified, the first
-               cookie value is returned.
+               This is an alias for "req.cook_val".
 
   dst          This is the destination IPv4 address of the session on the
                client side, which is the address the client connected to.
@@ -9683,36 +9675,18 @@ The list of currently supported pattern fetch functions is the following :
                logs using a log-format directive.
 
   hdr(<name>[,<occ>])
-               This extracts the last occurrence of header <name> in an HTTP
-               request. Optionally, a specific occurrence might be specified as
-               a position number. Positive values indicate a position from the
-               first occurrence, with 1 being the first one. Negative values
-               indicate positions relative to the last one, with -1 being the
-               last one. A typical use is with the X-Forwarded-For header once
-               converted to IP, associated with an IP stick-table.
+               This is an alias for "req.hdr" or "res.hdr" depending whether it
+               is used on the request path or the response path. Since it is
+               ambiguous, it is recommended not to use this form.
 
   hdr_cnt([<name>])
-               Returns an integer value representing the number of occurrences
-               of request header field name <name>, or the total number of
-               header fields if <name> is not specified.
+               This is an alias for "req.hdr_cnt".
 
   hdr_ip([<name>[,<occ>]])
-               This extracts the last occurrence of header <name> in an HTTP
-               request, converts it to an IPv4 or IPv6 address and returns this
-               address. Optionally, a specific occurrence might be specified as
-               a position number. Positive values indicate a position from the
-               first occurrence, with 1 being the first one. Negative values
-               indicate positions relative to the last one, with -1 being the
-               last one. A typical use is with the X-Forwarded-For header.
+               This is an alias for "req.hdr_ip".
 
   hdr_val([<name>[,<occ>]])
-               This extracts the last occurrence of header <name> in an HTTP
-               request, and converts it to an integer value. Optionally, a
-               specific occurrence might be specified as a position number.
-               Positive values indicate a position from the first occurrence,
-               with 1 being the first one. Negative values indicate positions
-               relative to the last one, with -1 being the last one. A typical
-               use is with the X-Forwarded-For header.
+               This is an alias for "req.hdr_val".
 
   http_auth(<userlist>)
   http_auth_group(<userlist>)
@@ -9816,16 +9790,71 @@ The list of currently supported pattern fetch functions is the following :
                with "server" lines having the "ssl" option. This is mostly used
                in ACL.
 
-  req_len      Returns an integer value corresponding to the number of bytes
-               present in the request buffer. This is mostly used in ACL.
+  req.cook([<name>])
+               This extracts the last occurrence of the cookie name <name> on a
+               "Cookie" header line from the request, and returns its value as
+               string. If no name is specified, the first cookie value is
+               returned.
 
-  req_proto_http
+  req.cook_cnt([<name>])
+               Returns an integer value representing the number of occurrences of
+               the cookie <name> in the request, or all cookies if <name> is not
+               specified.
+
+  req.cook_val([<name>])
+               This extracts the last occurrence of the cookie name <name> on a
+               "Cookie" header line from the request, and converts its value to
+               an integer which is returned. If no name is specified, the first
+               cookie value is returned.
+
+  req.hdr(<name>[,<occ>])
+               This extracts the last occurrence of header <name> in an HTTP
+               request. Optionally, a specific occurrence might be specified as
+               a position number. Positive values indicate a position from the
+               first occurrence, with 1 being the first one. Negative values
+               indicate positions relative to the last one, with -1 being the
+               last one. A typical use is with the X-Forwarded-For header once
+               converted to IP, associated with an IP stick-table.
+
+  req.hdr_cnt([<name>])
+               Returns an integer value representing the number of occurrences
+               of request header field name <name>, or the total number of
+               header fields if <name> is not specified.
+
+  req.hdr_ip([<name>[,<occ>]])
+               This extracts the last occurrence of header <name> in an HTTP
+               request, converts it to an IPv4 or IPv6 address and returns this
+               address. Optionally, a specific occurrence might be specified as
+               a position number. Positive values indicate a position from the
+               first occurrence, with 1 being the first one. Negative values
+               indicate positions relative to the last one, with -1 being the
+               last one. A typical use is with the X-Forwarded-For header.
+
+  req.hdr_val([<name>[,<occ>]])
+               This extracts the last occurrence of header <name> in an HTTP
+               request, and converts it to an integer value. Optionally, a
+               specific occurrence might be specified as a position number.
+               Positive values indicate a position from the first occurrence,
+               with 1 being the first one. Negative values indicate positions
+               relative to the last one, with -1 being the last one. A typical
+               use is with the X-Forwarded-For header.
+
+  req.proto_http
                Returns true when data in the request buffer look like HTTP and
                correctly parses as such. It is the same parser as the common
                HTTP request parser which is used so there should be no
                surprises. This test may be used to report the protocol in TCP
                logs.
 
+  req.ver      Returns the version string from the HTTP request, for example
+               "1.1". This can be useful for logs, but is mostly there for ACL.
+
+  req_len      Returns an integer value corresponding to the number of bytes
+               present in the request buffer. This is mostly used in ACL.
+
+  req_proto_http
+               This is an alias for "req_proto_http".
+
   req_ssl_hello_type
                Returns an integer value containing the type of the SSL hello
                message found in the request buffer. Note that this only applies
@@ -9849,12 +9878,63 @@ The list of currently supported pattern fetch functions is the following :
                data layer, so this will not work with "bind" lines having the
                "ssl" option. This is mostly used in ACL.
 
-  req_ver      Returns the version string from the HTTP request, for example
-               "1.1". This can be useful for logs, but is mostly there for ACL.
+  req_ver      This is an alias for "req.ver".
+
+  res.cook([<name>])
+               This extracts the last occurrence of the cookie name <name> on a
+               "Set-Cookie" header line from the response, and returns its
+               value as string. If no name is specified, the first cookie value
+               is returned.
+
+  res.cook_cnt([<name>])
+               Returns an integer value representing the number of occurrences of
+               the cookie <name> in the response, or all cookies if <name> is not
+               specified.
+
+  res.cook_val([<name>])
+               This extracts the last occurrence of the cookie name <name> on a
+               "Set-Cookie" header line from the response, and converts its
+               value to an integer which is returned. If no name is specified,
+               the first cookie value is returned.
+
+  res.hdr(<name>[,<occ>])
+               This extracts the last occurrence of header <name> in an HTTP
+               response. Optionally, a specific occurrence might be specified
+               as a position number. Positive values indicate a position from
+               the first occurrence, with 1 being the first one. Negative
+               values indicate positions relative to the last one, with -1
+               being the last one. This can be useful to learn some data into
+               a stick-table.
 
-  resp_ver     Returns the version string from the HTTP response, for example
+  res.hdr_cnt([<name>])
+               Returns an integer value representing the number of occurrences
+               of response header field name <name>, or the total number of
+               header fields if <name> is not specified.
+
+  res.hdr_ip([<name>[,<occ>]])
+               This extracts the last occurrence of header <name> in an HTTP
+               response, convert it to an IPv4 or IPv6 address and returns this
+               address. Optionally, a specific occurrence might be specified as
+               a position number. Positive values indicate a position from the
+               first occurrence, with 1 being the first one. Negative values
+               indicate positions relative to the last one, with -1 being the
+               last one. This can be useful to learn some data into a stick
+               table.
+
+  res.hdr_val([<name>[,<occ>]])
+               This extracts the last occurrence of header <name> in an HTTP
+               response, and converts it to an integer value. Optionally, a
+               specific occurrence might be specified as a position number.
+               Positive values indicate a position from the first occurrence,
+               with 1 being the first one. Negative values indicate positions
+               relative to the last one, with -1 being the last one. This can
+               be useful to learn some data into a stick table.
+
+  res.ver      Returns the version string from the HTTP response, for example
                "1.1". This can be useful for logs, but is mostly there for ACL.
 
+  resp_ver     This is an alias for "res.ver".
+
   sc1_bytes_in_rate
   sc2_bytes_in_rate
                Returns the average client-to-server bytes rate from the
@@ -9977,21 +10057,13 @@ The list of currently supported pattern fetch functions is the following :
                a given address for example.
 
   scook([<name>])
-               This extracts the last occurrence of the cookie name <name> on a
-               "Set-Cookie" header line from the response, and returns its
-               value as string. If no name is specified, the first cookie value
-               is returned.
+               This is an alias for "res.cook".
 
   scook_cnt([<name>])
-               Returns an integer value representing the number of occurrences of
-               the cookie <name> in the response, or all cookies if <name> is not
-               specified.
+               This is an alias for "res.cook_cnt".
 
   scook_val([<name>])
-               This extracts the last occurrence of the cookie name <name> on a
-               "Set-Cookie" header line from the response, and converts its
-               value to an integer which is returned. If no name is specified,
-               the first cookie value is returned.
+               This is an alias for "res.cook_val".
 
   set-cookie(<name>)
                This fetch function is deprecated and has been superseded by the
@@ -10007,37 +10079,16 @@ The list of currently supported pattern fetch functions is the following :
                See also : "appsession"
 
   shdr(<name>[,<occ>])
-               This extracts the last occurrence of header <name> in an HTTP
-               response. Optionally, a specific occurrence might be specified
-               as a position number. Positive values indicate a position from
-               the first occurrence, with 1 being the first one. Negative
-               values indicate positions relative to the last one, with -1
-               being the last one. This can be useful to learn some data into
-               a stick-table.
+               This is an alias for "res.hdr".
 
   shdr_cnt([<name>])
-               Returns an integer value representing the number of occurrences
-               of response header field name <name>, or the total number of
-               header fields if <name> is not specified.
+               This is an alias for "res.hdr_cnt".
 
   shdr_ip([<name>[,<occ>]])
-               This extracts the last occurrence of header <name> in an HTTP
-               response, convert it to an IPv4 or IPv6 address and returns this
-               address. Optionally, a specific occurrence might be specified as
-               a position number. Positive values indicate a position from the
-               first occurrence, with 1 being the first one. Negative values
-               indicate positions relative to the last one, with -1 being the
-               last one. This can be useful to learn some data into a stick
-               table.
+               This is an alias for "res.hdr_ip".
 
   shdr_val([<name>[,<occ>]])
-               This extracts the last occurrence of header <name> in an HTTP
-               response, and converts it to an integer value. Optionally, a
-               specific occurrence might be specified as a position number.
-               Positive values indicate a position from the first occurrence,
-               with 1 being the first one. Negative values indicate positions
-               relative to the last one, with -1 being the last one. This can
-               be useful to learn some data into a stick table.
+               This is an alias for "res.hdr_val".
 
   so_id        Returns an integer containing the listening socket's id.
 
index 020009a70d0624b4ba30eb8770a11e0c1aeedd8f..2dd3d735acafeb6400908393223c0089e11568c0 100644 (file)
@@ -9531,28 +9531,28 @@ static struct acl_kw_list acl_kws = {{ },{
        { "base_reg",        "base",          acl_parse_reg,     acl_match_reg,     ACL_USE_L7REQ_VOLATILE },
        { "base_sub",        "base",          acl_parse_str,     acl_match_sub,     ACL_USE_L7REQ_VOLATILE },
 
-       { "cook",            "cook",          acl_parse_str,     acl_match_str,     ACL_USE_L7REQ_VOLATILE },
-       { "cook_beg",        "cook",          acl_parse_str,     acl_match_beg,     ACL_USE_L7REQ_VOLATILE },
-       { "cook_cnt",        "cook_cnt",      acl_parse_int,     acl_match_int,     ACL_USE_L7REQ_VOLATILE },
-       { "cook_dir",        "cook",          acl_parse_str,     acl_match_dir,     ACL_USE_L7REQ_VOLATILE },
-       { "cook_dom",        "cook",          acl_parse_str,     acl_match_dom,     ACL_USE_L7REQ_VOLATILE },
-       { "cook_end",        "cook",          acl_parse_str,     acl_match_end,     ACL_USE_L7REQ_VOLATILE },
-       { "cook_len",        "cook",          acl_parse_int,     acl_match_len,     ACL_USE_L7REQ_VOLATILE },
-       { "cook_reg",        "cook",          acl_parse_reg,     acl_match_reg,     ACL_USE_L7REQ_VOLATILE },
-       { "cook_sub",        "cook",          acl_parse_str,     acl_match_sub,     ACL_USE_L7REQ_VOLATILE },
-       { "cook_val",        "cook_val",      acl_parse_int,     acl_match_int,     ACL_USE_L7REQ_VOLATILE },
-
-       { "hdr",             "hdr",           acl_parse_str,     acl_match_str,     ACL_USE_L7REQ_VOLATILE },
-       { "hdr_beg",         "hdr",           acl_parse_str,     acl_match_beg,     ACL_USE_L7REQ_VOLATILE },
-       { "hdr_cnt",         "hdr_cnt",       acl_parse_int,     acl_match_int,     ACL_USE_L7REQ_VOLATILE },
-       { "hdr_dir",         "hdr",           acl_parse_str,     acl_match_dir,     ACL_USE_L7REQ_VOLATILE },
-       { "hdr_dom",         "hdr",           acl_parse_str,     acl_match_dom,     ACL_USE_L7REQ_VOLATILE },
-       { "hdr_end",         "hdr",           acl_parse_str,     acl_match_end,     ACL_USE_L7REQ_VOLATILE },
-       { "hdr_ip",          "hdr_ip",        acl_parse_ip,      acl_match_ip,      ACL_USE_L7REQ_VOLATILE },
-       { "hdr_len",         "hdr",           acl_parse_int,     acl_match_len,     ACL_USE_L7REQ_VOLATILE },
-       { "hdr_reg",         "hdr",           acl_parse_reg,     acl_match_reg,     ACL_USE_L7REQ_VOLATILE },
-       { "hdr_sub",         "hdr",           acl_parse_str,     acl_match_sub,     ACL_USE_L7REQ_VOLATILE },
-       { "hdr_val",         "hdr_val",       acl_parse_int,     acl_match_int,     ACL_USE_L7REQ_VOLATILE },
+       { "cook",            "req.cook",      acl_parse_str,     acl_match_str,     ACL_USE_L7REQ_VOLATILE },
+       { "cook_beg",        "req.cook",      acl_parse_str,     acl_match_beg,     ACL_USE_L7REQ_VOLATILE },
+       { "cook_cnt",        "req.cook_cnt",  acl_parse_int,     acl_match_int,     ACL_USE_L7REQ_VOLATILE },
+       { "cook_dir",        "req.cook",      acl_parse_str,     acl_match_dir,     ACL_USE_L7REQ_VOLATILE },
+       { "cook_dom",        "req.cook",      acl_parse_str,     acl_match_dom,     ACL_USE_L7REQ_VOLATILE },
+       { "cook_end",        "req.cook",      acl_parse_str,     acl_match_end,     ACL_USE_L7REQ_VOLATILE },
+       { "cook_len",        "req.cook",      acl_parse_int,     acl_match_len,     ACL_USE_L7REQ_VOLATILE },
+       { "cook_reg",        "req.cook",      acl_parse_reg,     acl_match_reg,     ACL_USE_L7REQ_VOLATILE },
+       { "cook_sub",        "req.cook",      acl_parse_str,     acl_match_sub,     ACL_USE_L7REQ_VOLATILE },
+       { "cook_val",        "req.cook_val",  acl_parse_int,     acl_match_int,     ACL_USE_L7REQ_VOLATILE },
+
+       { "hdr",             "req.hdr",       acl_parse_str,     acl_match_str,     ACL_USE_L7REQ_VOLATILE },
+       { "hdr_beg",         "req.hdr",       acl_parse_str,     acl_match_beg,     ACL_USE_L7REQ_VOLATILE },
+       { "hdr_cnt",         "req.hdr_cnt",   acl_parse_int,     acl_match_int,     ACL_USE_L7REQ_VOLATILE },
+       { "hdr_dir",         "req.hdr",       acl_parse_str,     acl_match_dir,     ACL_USE_L7REQ_VOLATILE },
+       { "hdr_dom",         "req.hdr",       acl_parse_str,     acl_match_dom,     ACL_USE_L7REQ_VOLATILE },
+       { "hdr_end",         "req.hdr",       acl_parse_str,     acl_match_end,     ACL_USE_L7REQ_VOLATILE },
+       { "hdr_ip",          "req.hdr_ip",    acl_parse_ip,      acl_match_ip,      ACL_USE_L7REQ_VOLATILE },
+       { "hdr_len",         "req.hdr",       acl_parse_int,     acl_match_len,     ACL_USE_L7REQ_VOLATILE },
+       { "hdr_reg",         "req.hdr",       acl_parse_reg,     acl_match_reg,     ACL_USE_L7REQ_VOLATILE },
+       { "hdr_sub",         "req.hdr",       acl_parse_str,     acl_match_sub,     ACL_USE_L7REQ_VOLATILE },
+       { "hdr_val",         "req.hdr_val",   acl_parse_int,     acl_match_int,     ACL_USE_L7REQ_VOLATILE },
 
        { "http_auth",       NULL,            acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_VOLATILE },
        { "http_auth_group", NULL,            acl_parse_strcat,  acl_match_auth,    ACL_USE_L7REQ_VOLATILE },
@@ -9570,32 +9570,32 @@ static struct acl_kw_list acl_kws = {{ },{
        { "path_reg",        "path",          acl_parse_reg,     acl_match_reg,     ACL_USE_L7REQ_VOLATILE },
        { "path_sub",        "path",          acl_parse_str,     acl_match_sub,     ACL_USE_L7REQ_VOLATILE },
 
-       { "req_proto_http",  NULL,            acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_PERMANENT },
-       { "req_ver",         NULL,            acl_parse_ver,     acl_match_str,     ACL_USE_L7REQ_VOLATILE  },
-       { "resp_ver",        NULL,            acl_parse_ver,     acl_match_str,     ACL_USE_L7RTR_VOLATILE  },
-
-       { "scook",           "scook",         acl_parse_str,     acl_match_str,     ACL_USE_L7RTR_VOLATILE },
-       { "scook_beg",       "scook",         acl_parse_str,     acl_match_beg,     ACL_USE_L7RTR_VOLATILE },
-       { "scook_cnt",       "scook_cnt",     acl_parse_int,     acl_match_int,     ACL_USE_L7RTR_VOLATILE },
-       { "scook_dir",       "scook",         acl_parse_str,     acl_match_dir,     ACL_USE_L7RTR_VOLATILE },
-       { "scook_dom",       "scook",         acl_parse_str,     acl_match_dom,     ACL_USE_L7RTR_VOLATILE },
-       { "scook_end",       "scook",         acl_parse_str,     acl_match_end,     ACL_USE_L7RTR_VOLATILE },
-       { "scook_len",       "scook",         acl_parse_int,     acl_match_len,     ACL_USE_L7RTR_VOLATILE },
-       { "scook_reg",       "scook",         acl_parse_reg,     acl_match_reg,     ACL_USE_L7RTR_VOLATILE },
-       { "scook_sub",       "scook",         acl_parse_str,     acl_match_sub,     ACL_USE_L7RTR_VOLATILE },
-       { "scook_val",       "scook_val",     acl_parse_int,     acl_match_int,     ACL_USE_L7RTR_VOLATILE },
-
-       { "shdr",            "shdr",          acl_parse_str,     acl_match_str,     ACL_USE_L7RTR_VOLATILE },
-       { "shdr_beg",        "shdr",          acl_parse_str,     acl_match_beg,     ACL_USE_L7RTR_VOLATILE },
-       { "shdr_cnt",        "shdr_cnt",      acl_parse_int,     acl_match_int,     ACL_USE_L7RTR_VOLATILE },
-       { "shdr_dir",        "shdr",          acl_parse_str,     acl_match_dir,     ACL_USE_L7RTR_VOLATILE },
-       { "shdr_dom",        "shdr",          acl_parse_str,     acl_match_dom,     ACL_USE_L7RTR_VOLATILE },
-       { "shdr_end",        "shdr",          acl_parse_str,     acl_match_end,     ACL_USE_L7RTR_VOLATILE },
-       { "shdr_ip",         "shdr_ip",       acl_parse_ip,      acl_match_ip,      ACL_USE_L7RTR_VOLATILE },
-       { "shdr_len",        "shdr",          acl_parse_int,     acl_match_len,     ACL_USE_L7RTR_VOLATILE },
-       { "shdr_reg",        "shdr",          acl_parse_reg,     acl_match_reg,     ACL_USE_L7RTR_VOLATILE },
-       { "shdr_sub",        "shdr",          acl_parse_str,     acl_match_sub,     ACL_USE_L7RTR_VOLATILE },
-       { "shdr_val",        "shdr_val",      acl_parse_int,     acl_match_int,     ACL_USE_L7RTR_VOLATILE },
+       { "req_proto_http",  "req.proto_http",acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_PERMANENT },
+       { "req_ver",         "req.ver",       acl_parse_ver,     acl_match_str,     ACL_USE_L7REQ_VOLATILE  },
+       { "resp_ver",        "res.ver",       acl_parse_ver,     acl_match_str,     ACL_USE_L7RTR_VOLATILE  },
+
+       { "scook",           "res.cook",      acl_parse_str,     acl_match_str,     ACL_USE_L7RTR_VOLATILE },
+       { "scook_beg",       "res.cook",      acl_parse_str,     acl_match_beg,     ACL_USE_L7RTR_VOLATILE },
+       { "scook_cnt",       "res.cook_cnt",  acl_parse_int,     acl_match_int,     ACL_USE_L7RTR_VOLATILE },
+       { "scook_dir",       "res.cook",      acl_parse_str,     acl_match_dir,     ACL_USE_L7RTR_VOLATILE },
+       { "scook_dom",       "res.cook",      acl_parse_str,     acl_match_dom,     ACL_USE_L7RTR_VOLATILE },
+       { "scook_end",       "res.cook",      acl_parse_str,     acl_match_end,     ACL_USE_L7RTR_VOLATILE },
+       { "scook_len",       "res.cook",      acl_parse_int,     acl_match_len,     ACL_USE_L7RTR_VOLATILE },
+       { "scook_reg",       "res.cook",      acl_parse_reg,     acl_match_reg,     ACL_USE_L7RTR_VOLATILE },
+       { "scook_sub",       "res.cook",      acl_parse_str,     acl_match_sub,     ACL_USE_L7RTR_VOLATILE },
+       { "scook_val",       "res.cook_val",  acl_parse_int,     acl_match_int,     ACL_USE_L7RTR_VOLATILE },
+
+       { "shdr",            "res.hdr",       acl_parse_str,     acl_match_str,     ACL_USE_L7RTR_VOLATILE },
+       { "shdr_beg",        "res.hdr",       acl_parse_str,     acl_match_beg,     ACL_USE_L7RTR_VOLATILE },
+       { "shdr_cnt",        "res.hdr_cnt",   acl_parse_int,     acl_match_int,     ACL_USE_L7RTR_VOLATILE },
+       { "shdr_dir",        "res.hdr",       acl_parse_str,     acl_match_dir,     ACL_USE_L7RTR_VOLATILE },
+       { "shdr_dom",        "res.hdr",       acl_parse_str,     acl_match_dom,     ACL_USE_L7RTR_VOLATILE },
+       { "shdr_end",        "res.hdr",       acl_parse_str,     acl_match_end,     ACL_USE_L7RTR_VOLATILE },
+       { "shdr_ip",         "res.hdr_ip",    acl_parse_ip,      acl_match_ip,      ACL_USE_L7RTR_VOLATILE },
+       { "shdr_len",        "res.hdr",       acl_parse_int,     acl_match_len,     ACL_USE_L7RTR_VOLATILE },
+       { "shdr_reg",        "res.hdr",       acl_parse_reg,     acl_match_reg,     ACL_USE_L7RTR_VOLATILE },
+       { "shdr_sub",        "res.hdr",       acl_parse_str,     acl_match_sub,     ACL_USE_L7RTR_VOLATILE },
+       { "shdr_val",        "res.hdr_val",   acl_parse_int,     acl_match_int,     ACL_USE_L7RTR_VOLATILE },
 
        { "status",          NULL,            acl_parse_int,     acl_match_int,     ACL_USE_L7RTR_PERMANENT },
 
@@ -9656,10 +9656,39 @@ static struct sample_fetch_kw_list sample_fetch_keywords = {{ },{
        { "http_first_req",  smp_fetch_http_first_req, 0,                NULL,    SMP_T_BOOL, SMP_USE_HRQHP },
        { "method",          smp_fetch_meth,           0,                NULL,    SMP_T_UINT, SMP_USE_HRQHP },
        { "path",            smp_fetch_path,           0,                NULL,    SMP_T_CSTR, SMP_USE_HRQHV },
+
+       /* HTTP protocol on the request path */
+       { "req.proto_http",  smp_fetch_proto_http,     0,                NULL,    SMP_T_BOOL, SMP_USE_HRQHP },
        { "req_proto_http",  smp_fetch_proto_http,     0,                NULL,    SMP_T_BOOL, SMP_USE_HRQHP },
+
+       /* HTTP version on the request path */
+       { "req.ver",         smp_fetch_rqver,          0,                NULL,    SMP_T_CSTR, SMP_USE_HRQHV },
        { "req_ver",         smp_fetch_rqver,          0,                NULL,    SMP_T_CSTR, SMP_USE_HRQHV },
+
+       /* HTTP version on the response path */
+       { "res.ver",         smp_fetch_stver,          0,                NULL,    SMP_T_CSTR, SMP_USE_HRSHV },
        { "resp_ver",        smp_fetch_stver,          0,                NULL,    SMP_T_CSTR, SMP_USE_HRSHV },
 
+       /* explicit req.{cook,hdr} are used to force the fetch direction to be request-only */
+       { "req.cook",        smp_fetch_cookie,         ARG1(0,STR),      NULL,    SMP_T_CSTR, SMP_USE_HRQHV },
+       { "req.cook_cnt",    smp_fetch_cookie_cnt,     ARG1(0,STR),      NULL,    SMP_T_UINT, SMP_USE_HRQHV },
+       { "req.cook_val",    smp_fetch_cookie_val,     ARG1(0,STR),      NULL,    SMP_T_UINT, SMP_USE_HRQHV },
+
+       { "req.hdr",         smp_fetch_hdr,            ARG2(0,STR,SINT), val_hdr, SMP_T_CSTR, SMP_USE_HRQHV },
+       { "req.hdr_cnt",     smp_fetch_hdr_cnt,        ARG1(0,STR),      NULL,    SMP_T_UINT, SMP_USE_HRQHV },
+       { "req.hdr_ip",      smp_fetch_hdr_ip,         ARG2(0,STR,SINT), val_hdr, SMP_T_IPV4, SMP_USE_HRQHV },
+       { "req.hdr_val",     smp_fetch_hdr_val,        ARG2(0,STR,SINT), val_hdr, SMP_T_UINT, SMP_USE_HRQHV },
+
+       /* explicit req.{cook,hdr} are used to force the fetch direction to be response-only */
+       { "res.cook",        smp_fetch_cookie,         ARG1(0,STR),      NULL,    SMP_T_CSTR, SMP_USE_HRSHV },
+       { "res.cook_cnt",    smp_fetch_cookie_cnt,     ARG1(0,STR),      NULL,    SMP_T_UINT, SMP_USE_HRSHV },
+       { "res.cook_val",    smp_fetch_cookie_val,     ARG1(0,STR),      NULL,    SMP_T_UINT, SMP_USE_HRSHV },
+
+       { "res.hdr",         smp_fetch_hdr,            ARG2(0,STR,SINT), val_hdr, SMP_T_CSTR, SMP_USE_HRSHV },
+       { "res.hdr_cnt",     smp_fetch_hdr_cnt,        ARG1(0,STR),      NULL,    SMP_T_UINT, SMP_USE_HRSHV },
+       { "res.hdr_ip",      smp_fetch_hdr_ip,         ARG2(0,STR,SINT), val_hdr, SMP_T_IPV4, SMP_USE_HRSHV },
+       { "res.hdr_val",     smp_fetch_hdr_val,        ARG2(0,STR,SINT), val_hdr, SMP_T_UINT, SMP_USE_HRSHV },
+
        /* scook is valid only on the response and is used for ACL compatibility */
        { "scook",           smp_fetch_cookie,         ARG1(0,STR),      NULL,    SMP_T_CSTR, SMP_USE_HRSHV },
        { "scook_cnt",       smp_fetch_cookie_cnt,     ARG1(0,STR),      NULL,    SMP_T_UINT, SMP_USE_HRSHV },