diff --git a/doc/lua-api/index.rst b/doc/lua-api/index.rst index bab55228c..8a29bc5b5 100644 --- a/doc/lua-api/index.rst +++ b/doc/lua-api/index.rst @@ -493,7 +493,7 @@ Core class :param string name: is the name of the action. :param table actions: is a table of string describing the HAProxy actions facilities where to expose the new action. Expected facilities are: - 'tcp-req', 'tcp-res', 'http-req' or 'http-res'. + 'tcp-req', 'tcp-res', 'http-req', 'http-res', 'http-after-res'. :param function func: is the Lua function called to work as an action. :param integer nb_args: is the expected number of argument for the action. By default the value is 0. diff --git a/src/hlua.c b/src/hlua.c index e125eff82..de32c524e 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -10984,6 +10984,8 @@ __LJMP static int hlua_register_action(lua_State *L) akw = action_http_req_custom(trash->area); } else if (strcmp(lua_tostring(L, -1), "http-res") == 0) { akw = action_http_res_custom(trash->area); + } else if (strcmp(lua_tostring(L, -1), "http-after-res") == 0) { + akw = action_http_after_res_custom(trash->area); } else { akw = NULL; } @@ -11043,6 +11045,8 @@ __LJMP static int hlua_register_action(lua_State *L) http_req_keywords_register(akl); else if (strcmp(lua_tostring(L, -1), "http-res") == 0) http_res_keywords_register(akl); + else if (strcmp(lua_tostring(L, -1), "http-after-res") == 0) + http_after_res_keywords_register(akl); else { release_hlua_function(fcn); hlua_unref(L, ref); @@ -11050,7 +11054,8 @@ __LJMP static int hlua_register_action(lua_State *L) ha_free((char **)&(akl->kw[0].kw)); ha_free(&akl); WILL_LJMP(luaL_error(L, "Lua action environment '%s' is unknown. " - "'tcp-req', 'tcp-res', 'http-req' or 'http-res' " + "'tcp-req', 'tcp-res', 'http-req', 'http-res' " + "or 'http-after-res' " "are expected.", lua_tostring(L, -1))); }