Browse Source

Allow mg.redirect for lua scripts and server pages

bel2125 6 years ago
parent
commit
b1a3fa31c8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/mod_lua.inl

+ 1 - 1
src/mod_lua.inl

@@ -2163,11 +2163,11 @@ prepare_lua_environment(struct mg_context *ctx,
 		reg_conn_function(L, "keep_alive", lsp_keep_alive, conn);
 		reg_conn_function(L, "send_file", lsp_send_file, conn);
 		reg_conn_function(L, "send_file_body", lsp_send_file_body, conn);
+		reg_conn_function(L, "redirect", lsp_redirect, conn);
 	}
 
 	if (lua_env_type == LUA_ENV_TYPE_LUA_SERVER_PAGE) {
 		reg_conn_function(L, "include", lsp_include, conn);
-		reg_conn_function(L, "redirect", lsp_redirect, conn);
 	}
 
 	if (lua_env_type == LUA_ENV_TYPE_LUA_WEBSOCKET) {