mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
fix(rest) onFSGet: if !isStr stringifyJSON
This commit is contained in:
parent
1cb8071bc6
commit
e105fb493d
1 changed files with 8 additions and 2 deletions
|
|
@ -169,7 +169,8 @@
|
|||
switch (p.request.method) {
|
||||
case 'GET':
|
||||
onFSGet(query, p.name, function(error, data, isFile) {
|
||||
var str;
|
||||
var str,
|
||||
isStr = Util.isString(data);
|
||||
|
||||
if (error)
|
||||
sendError(params, error);
|
||||
|
|
@ -177,7 +178,12 @@
|
|||
main.sendFile(p);
|
||||
else {
|
||||
p.name += '.json';
|
||||
str = Util.stringifyJSON(data);
|
||||
|
||||
if (isStr)
|
||||
str = data;
|
||||
else
|
||||
str = Util.stringifyJSON(data);
|
||||
|
||||
sendResponse(p, str, NOT_LOG);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue