]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: lua/htx: Make txn.req_req_* and txn.res_rep_* HTX aware
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 17 Jun 2019 11:36:06 +0000 (13:36 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 17 Jun 2019 11:42:45 +0000 (13:42 +0200)
These bindings were not updated to support HTX streams.

This patch must be backported to 2.0 and 1.9. It fixes the issue #124.

src/hlua.c

index 28abd0836e630d57796d440483f7c7f288a593ec..32f0e8db9314cf256149b658934bbf7d2cfd45b2 100644 (file)
@@ -5375,7 +5375,13 @@ __LJMP static inline int hlua_http_rep_hdr(lua_State *L, struct hlua_txn *htxn,
        if (!(re = regex_comp(reg, 1, 1, NULL)))
                WILL_LJMP(luaL_argerror(L, 3, "invalid regex"));
 
-       http_transform_header_str(htxn->s, msg, name, name_len, value, re, action);
+       if (IS_HTX_STRM(htxn->s)) {
+               struct htx *htx = htxbuf(&msg->chn->buf);
+
+               htx_transform_header_str(htxn->s, msg->chn, htx, ist2(name, name_len), value, re, action);
+       }
+       else
+               http_transform_header_str(htxn->s, msg, name, name_len, value, re, action);
        regex_free(re);
        return 0;
 }