mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
feat: Bytearray request body support
This commit is contained in:
parent
762634ea04
commit
dad67db835
1 changed files with 5 additions and 1 deletions
|
|
@ -102,7 +102,11 @@ static int l_request(lua::State* L, network::Network& network) {
|
||||||
lua::pop(L);
|
lua::pop(L);
|
||||||
}
|
}
|
||||||
if (lua::getfield(L, "body", 2)) {
|
if (lua::getfield(L, "body", 2)) {
|
||||||
request.body = lua::require_lstring(L, -1);
|
if (lua::type(L, -1) == LUA_TCDATA) {
|
||||||
|
request.body = lua::bytearray_as_string(L, -1);
|
||||||
|
} else {
|
||||||
|
request.body = lua::require_lstring(L, -1);
|
||||||
|
}
|
||||||
lua::pop(L);
|
lua::pop(L);
|
||||||
}
|
}
|
||||||
if (lua::getfield(L, "follow_location", 2)) {
|
if (lua::getfield(L, "follow_location", 2)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue