fix(rest) onFSGet: if !isStr stringifyJSON

This commit is contained in:
coderaiser 2014-05-23 10:18:55 -04:00
parent 1cb8071bc6
commit e105fb493d

View file

@ -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);
}
});