diff --git a/bin/tsw/util/auto-report/logReport.js b/bin/tsw/util/auto-report/logReport.js index 5f434903..7a5c3c90 100644 --- a/bin/tsw/util/auto-report/logReport.js +++ b/bin/tsw/util/auto-report/logReport.js @@ -291,6 +291,30 @@ module.exports.receiveCloud = function(req, res) { return returnJson('get appkey error'); } + if (data.logText) { + return returnJson('logText is invalid'); + } + + if (typeof data.logText !== 'string') { + return returnJson('logText is not string'); + } + + if (data.logText.length >= 64 * 1024) { + return returnJson('logText is large than 64KB'); + } + + if (!data.logJson) { + return returnJson('logJson is invalid'); + } + + if (typeof data.logJson !== 'string') { + return returnJson('logJson is not string'); + } + + if (data.logText.length >= 1024 * 1024) { + return returnJson('logJson is large than 1MB'); + } + const appid = context.appid; const appkey = context.appkey; const reportKey = [appid, data.key].join('/');