]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: hlua: Check the calling direction in lua functions of the HTTP class
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 26 Jul 2019 14:17:01 +0000 (16:17 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 29 Jul 2019 09:17:52 +0000 (11:17 +0200)
commit84a6d5bc217a418db8efc4e76a0a32860db2c608
tree31567562d3e5ea9dfb471bc8773bd8d6d1a12424
parentfe6a71b8e08234dbe03fbd2fa3017590681479df
BUG/MEDIUM: hlua: Check the calling direction in lua functions of the HTTP class

It is invalid to manipulate responses from http-request rules or to manipulate
requests from http-response rules. When http-request rules are evaluated, the
connection to server is not yet established, so there is no response at all. And
when http-response rules are evaluated, the request has already been sent to the
server.

Now, the calling direction is checked. So functions "txn.http:req_*" can now
only be called from http-request rules and the functions "txn.http:res_*" can
only be called from http-response rules.

This issue was reported on Github (#190).

This patch must be backported to all versions since the 1.6.
src/hlua.c