mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-08-29 00:01:29 +00:00
FIX - isolate custom app JSON payload
This commit is contained in:
@@ -280,7 +280,8 @@ local function normalize_json_payload(payload, maximum_bytes)
|
||||
return nil, "payload_too_large"
|
||||
end
|
||||
|
||||
return json.decode(encoded)
|
||||
local decoded = json.decode(encoded)
|
||||
return decoded
|
||||
end
|
||||
|
||||
local function validate_optional_text(value, error_code, maximum_length)
|
||||
|
||||
@@ -24,10 +24,16 @@ Config = {
|
||||
}
|
||||
|
||||
json = {
|
||||
decode = function()
|
||||
decode = function(encoded)
|
||||
if encoded == "null" then
|
||||
return nil, 5
|
||||
end
|
||||
return {}
|
||||
end,
|
||||
encode = function()
|
||||
encode = function(value)
|
||||
if value == nil then
|
||||
return "null"
|
||||
end
|
||||
return "{}"
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user