mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Add undocumented IsHeaderRepeatable to redbean
This API is intended to help unblock framework code. It should ideally be abstracted by redbean which is why it's undocumented. See #97
This commit is contained in:
parent
7064d736e3
commit
98192c1079
1 changed files with 18 additions and 2 deletions
|
@ -5035,6 +5035,21 @@ static int LuaIsHiddenPath(lua_State *L) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int LuaIsHeaderRepeatable(lua_State *L) {
|
||||||
|
int h;
|
||||||
|
bool r;
|
||||||
|
size_t n;
|
||||||
|
const char *s;
|
||||||
|
s = luaL_checklstring(L, 1, &n);
|
||||||
|
if ((h = GetHttpHeader(s, n)) == -1) {
|
||||||
|
r = kHttpRepeatable[h];
|
||||||
|
} else {
|
||||||
|
r = false;
|
||||||
|
}
|
||||||
|
lua_pushboolean(L, r);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int LuaGetZipPaths(lua_State *L) {
|
static int LuaGetZipPaths(lua_State *L) {
|
||||||
char *path;
|
char *path;
|
||||||
uint8_t *zcf;
|
uint8_t *zcf;
|
||||||
|
@ -5359,12 +5374,11 @@ static const luaL_Reg kLuaFuncs[] = {
|
||||||
{"FormatHttpDateTime", LuaFormatHttpDateTime}, //
|
{"FormatHttpDateTime", LuaFormatHttpDateTime}, //
|
||||||
{"FormatIp", LuaFormatIp}, //
|
{"FormatIp", LuaFormatIp}, //
|
||||||
{"GetAssetComment", LuaGetAssetComment}, //
|
{"GetAssetComment", LuaGetAssetComment}, //
|
||||||
{"GetComment", LuaGetAssetComment}, //
|
|
||||||
{"GetAssetMode", LuaGetAssetMode}, //
|
{"GetAssetMode", LuaGetAssetMode}, //
|
||||||
{"GetAssetSize", LuaGetAssetSize}, //
|
{"GetAssetSize", LuaGetAssetSize}, //
|
||||||
{"GetBody", LuaGetBody}, //
|
{"GetBody", LuaGetBody}, //
|
||||||
{"GetPayload", LuaGetBody}, //
|
|
||||||
{"GetClientAddr", LuaGetClientAddr}, //
|
{"GetClientAddr", LuaGetClientAddr}, //
|
||||||
|
{"GetComment", LuaGetAssetComment}, //
|
||||||
{"GetCookie", LuaGetCookie}, //
|
{"GetCookie", LuaGetCookie}, //
|
||||||
{"GetCryptoHash", LuaGetCryptoHash}, //
|
{"GetCryptoHash", LuaGetCryptoHash}, //
|
||||||
{"GetDate", LuaGetDate}, //
|
{"GetDate", LuaGetDate}, //
|
||||||
|
@ -5384,6 +5398,7 @@ static const luaL_Reg kLuaFuncs[] = {
|
||||||
{"GetParams", LuaGetParams}, //
|
{"GetParams", LuaGetParams}, //
|
||||||
{"GetPass", LuaGetPass}, //
|
{"GetPass", LuaGetPass}, //
|
||||||
{"GetPath", LuaGetPath}, //
|
{"GetPath", LuaGetPath}, //
|
||||||
|
{"GetPayload", LuaGetBody}, //
|
||||||
{"GetPort", LuaGetPort}, //
|
{"GetPort", LuaGetPort}, //
|
||||||
{"GetRandomBytes", LuaGetRandomBytes}, //
|
{"GetRandomBytes", LuaGetRandomBytes}, //
|
||||||
{"GetRedbeanVersion", LuaGetRedbeanVersion}, //
|
{"GetRedbeanVersion", LuaGetRedbeanVersion}, //
|
||||||
|
@ -5404,6 +5419,7 @@ static const luaL_Reg kLuaFuncs[] = {
|
||||||
{"IsAcceptablePort", LuaIsAcceptablePort}, //
|
{"IsAcceptablePort", LuaIsAcceptablePort}, //
|
||||||
{"IsCompressed", LuaIsCompressed}, //
|
{"IsCompressed", LuaIsCompressed}, //
|
||||||
{"IsDaemon", LuaIsDaemon}, //
|
{"IsDaemon", LuaIsDaemon}, //
|
||||||
|
{"IsHeaderRepeatable", LuaIsHeaderRepeatable}, //
|
||||||
{"IsHiddenPath", LuaIsHiddenPath}, //
|
{"IsHiddenPath", LuaIsHiddenPath}, //
|
||||||
{"IsLoopbackClient", LuaIsLoopbackClient}, //
|
{"IsLoopbackClient", LuaIsLoopbackClient}, //
|
||||||
{"IsLoopbackIp", LuaIsLoopbackIp}, //
|
{"IsLoopbackIp", LuaIsLoopbackIp}, //
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue