瀏覽代碼

Allow mg.redirect for lua scripts and server pages

bel2125 6 年之前
父節點
當前提交
b1a3fa31c8
共有 1 個文件被更改,包括 1 次插入1 次删除
  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) {