From 7f32b00f1a92ac220994036ddf4c49d31492841a Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Mon, 1 Nov 2021 19:22:39 -0700 Subject: [PATCH] Restore GetPayload and GetComment for compatibility (marked as deprecated in the docs) --- tool/net/help.txt | 3 ++- tool/net/redbean.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tool/net/help.txt b/tool/net/help.txt index 9c21645e6..ff3a1c0d7 100644 --- a/tool/net/help.txt +++ b/tool/net/help.txt @@ -594,7 +594,7 @@ FUNCTIONS GetAssetComment(path:str) → str Returns comment text associated with asset in the ZIP central - directory. + directory. Also available as GetComment (deprecated). GetAssetMode(path:str) → int Returns UNIX-style octal mode for ZIP asset (or local file if the @@ -606,6 +606,7 @@ FUNCTIONS GetBody() → str Returns the request message body if present or an empty string. + Also available as GetPayload (deprecated). GetCookie(name:str) → str Returns cookie value. diff --git a/tool/net/redbean.c b/tool/net/redbean.c index 095c3defd..e40e0e182 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -5332,9 +5332,11 @@ static const luaL_Reg kLuaFuncs[] = { {"FormatHttpDateTime", LuaFormatHttpDateTime}, // {"FormatIp", LuaFormatIp}, // {"GetAssetComment", LuaGetAssetComment}, // + {"GetComment", LuaGetAssetComment}, // {"GetAssetMode", LuaGetAssetMode}, // {"GetAssetSize", LuaGetAssetSize}, // {"GetBody", LuaGetBody}, // + {"GetPayload", LuaGetBody}, // {"GetClientAddr", LuaGetClientAddr}, // {"GetCookie", LuaGetCookie}, // {"GetDate", LuaGetDate}, //