Skip to content
Browse files

Stringify json result at the action result level rather than the serv…

…er level.
  • Loading branch information...
1 parent 8c8e125 commit f091b04cba008046ba31e95afd3e3b3fe8839886 @thatismatt committed Jul 5, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/josi/actionresults.js
  2. +1 −1 lib/josi/server.js
View
2 lib/josi/actionresults.js
@@ -136,7 +136,7 @@ this.raw = function(data) {
};
this.json = function(data) {
- return new ActionResult(data, { 'Content-Type': 'application/json' });
+ return new ActionResult(JSON.stringify(data), { 'Content-Type': 'application/json' });
};
this.content = function(filename) {
View
2 lib/josi/server.js
@@ -28,7 +28,7 @@ this.Server = function(dir) {
}
return actionResult;
} else if (actionResult instanceof Object) {
- return actionresults.json(JSON.stringify(actionResult));
+ return actionresults.json(actionResult);
} else if (typeof actionResult === 'string') {
return actionresults.raw(actionResult);
} else {

0 comments on commit f091b04

Please sign in to comment.
Something went wrong with that request. Please try again.