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
static int hlua_applet_http_new(lua_State *L, struct appctx *ctx)
{
struct hlua_appctx *appctx;
+ struct hlua_txn htxn;
struct stream_interface *si = ctx->owner;
struct stream *s = si_strm(si);
struct proxy *px = s->be;
lua_pushlstring(L, txn->req.chn->buf->p + txn->req.sl.rq.v, txn->req.sl.rq.v_l);
lua_settable(L, -3);
+ /* creates an array of headers. hlua_http_get_headers() crates and push
+ * the array on the top of the stack.
+ */
+ lua_pushstring(L, "headers");
+ htxn.s = s;
+ htxn.p = px;
+ htxn.dir = SMP_OPT_DIR_REQ;
+ if (!hlua_http_get_headers(L, &htxn, &htxn.s->txn->req))
+ return 0;
+ lua_settable(L, -3);
+
/* Get path and qs */
path = http_get_path(txn);
end = txn->req.chn->buf->p + txn->req.sl.rq.u + txn->req.sl.rq.u_l;