1
0
Fork 0

Foxx: Fix error for `body()` when body is empty

This commit is contained in:
Lucas Dohmen 2014-06-23 14:14:22 +02:00
parent 38e4853a99
commit f62ce6cd7f
1 changed files with 2 additions and 1 deletions

View File

@ -61,7 +61,8 @@ BaseMiddleware = function () {
////////////////////////////////////////////////////////////////////////////////
body: function () {
return JSON.parse(this.requestBody);
var requestBody = this.requestBody || '{}';
return JSON.parse(requestBody);
},
////////////////////////////////////////////////////////////////////////////////