HttpResponseCreator._parseUrlEventContent function returns {} when ParseJSON is invalid. It may lead to caching invalid responses. At this point, the app knows that the response body is a non-empty string and JSON format is expected. Thus failed JSON parsing suggests that body is corrupted, and caching it may lead to unexpected behavior.
prototype._parseUrlEventContent = function (urlEvent as Object) as Object
if (NOT m._isJsonResponse(urlEvent)) then return {}
content = urlEvent.getString()
if (content = "") then return {}
data = ParseJSON(content)
if (data = Invalid) then return {}
return data
end function
This is a Feature Proposal
Description
HttpResponseCreator._parseUrlEventContent
function returns{}
whenParseJSON
is invalid. It may lead to caching invalid responses. At this point, the app knows that the response body is a non-empty string and JSON format is expected. Thus failed JSON parsing suggests that body is corrupted, and caching it may lead to unexpected behavior.