MEDIUM: filters/lua: Add HTTPMessage class to help HTTP filtering
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 26 Feb 2020 15:57:19 +0000 (16:57 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Aug 2021 06:57:07 +0000 (08:57 +0200)
commitdf97ac45845d3e978c2fd18a2e2ab948e6140d76
tree4095eae7f442807eb6b39be543a9ae2caaa44f69
parentc404f1126cdaad4cf12fb1e10459947a751b8428
MEDIUM: filters/lua: Add HTTPMessage class to help HTTP filtering

This new class exposes methods to manipulate HTTP messages from a filter
written in lua. Like for the HTTP class, there is a bunch of methods to
manipulate the message headers. But there are also methods to manipulate the
message payload. This part is similar to what is available in the Channel
class. Thus the payload can be duplicated, erased, modified or
forwarded. For now, only DATA blocks can be retrieved and modified because
the current API is limited. No HTTPMessage method is able to yield. Those
manipulating the headers are always called on messages containing all the
headers, so there is no reason to yield. Those manipulating the payload are
called from the http_payload filters callback function where yielding is
forbidden.

When an HTTPMessage object is instantiated, the underlying Channel object
can be retrieved via the ".channel" field.

For now this class is not used because the HTTP filtering is not supported
yet. It will be the purpose of another commit.

There is no documentation for now.
include/haproxy/hlua-t.h
src/hlua.c