MINOR: lua: service/applet can have access to the HTTP headers when a POST is received
When a POST is processed by a Lua service, the HTTP header are
potentially gone. So, we cannot retrieve their content using
the standard "hdr" sample fetchs (which will soon become invalid
anyway) from an applet.
This patch add an entry "headers" to the object applet_http. This
entry is an array containing all the headers. It permits to use the
HTTP headers during the processing of the service.
Many thanks to Jan Bruder for reporting this issue with enough
details to reproduce it.
This patch will have to be backported to 1.6 since it will be the
only way to access headers from Lua applets.
diff --git a/doc/lua-api/index.rst b/doc/lua-api/index.rst
index 60c9725..9972c49 100644
--- a/doc/lua-api/index.rst
+++ b/doc/lua-api/index.rst
@@ -1369,6 +1369,10 @@
end)
+.. js:attribute:: AppletHTTP.headers
+
+ Contains an array containing all the request headers.
+
.. js:function:: AppletHTTP.set_status(code)
This function sets the HTTP status code for the response. The allowed code are