]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http: make resp_ver and status ACLs check for the presence of a response
authorWilly Tarreau <w@1wt.eu>
Fri, 14 Dec 2012 07:33:14 +0000 (08:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Dec 2012 07:35:45 +0000 (08:35 +0100)
The two ACL fetches "resp_ver" and "status", if used in a request despite
the warning, would return a match of zero length. This is inappropriate,
better return a non-match to be more consistent with other ACL processing.

src/proto_http.c

index 89b55b30066094d2f05f3e8b8e1c6bab6e3e0e31..6ec1d64925bfec0d2b25e83cdb581bfe7cad6cef 100644 (file)
@@ -8187,6 +8187,9 @@ acl_fetch_stver(struct proxy *px, struct session *l4, void *l7, unsigned int opt
 
        CHECK_HTTP_MESSAGE_FIRST();
 
+       if (txn->rsp.msg_state < HTTP_MSG_BODY)
+               return 0;
+
        len = txn->rsp.sl.st.v_l;
        ptr = txn->rsp.chn->buf->p;
 
@@ -8213,6 +8216,9 @@ acl_fetch_stcode(struct proxy *px, struct session *l4, void *l7, unsigned int op
 
        CHECK_HTTP_MESSAGE_FIRST();
 
+       if (txn->rsp.msg_state < HTTP_MSG_BODY)
+               return 0;
+
        len = txn->rsp.sl.st.c_l;
        ptr = txn->rsp.chn->buf->p + txn->rsp.sl.st.c;