mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 08:18:30 +00:00
Improve redbean method=get parameter handling
This commit is contained in:
parent
6e582d245b
commit
2cc1d5ac4c
9 changed files with 175 additions and 146 deletions
4
third_party/lua/luaparseurl.c
vendored
4
third_party/lua/luaparseurl.c
vendored
|
@ -36,12 +36,14 @@ static void LuaSetUrlView(lua_State *L, struct UrlView *v, const char *k) {
|
|||
}
|
||||
|
||||
int LuaParseUrl(lua_State *L) {
|
||||
int f;
|
||||
void *m;
|
||||
size_t n;
|
||||
struct Url h;
|
||||
const char *p;
|
||||
p = luaL_checklstring(L, 1, &n);
|
||||
m = ParseUrl(p, n, &h);
|
||||
f = luaL_optinteger(L, 2, 0);
|
||||
m = ParseUrl(p, n, &h, f);
|
||||
lua_newtable(L);
|
||||
LuaSetUrlView(L, &h.scheme, "scheme");
|
||||
LuaSetUrlView(L, &h.user, "user");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue