Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

minor fixes based on sproutit's ff85248

  • Loading branch information...
commit 5d70b7aef21ede1d20d68d9894d3cb5f67a5accd 1 parent fe4824e
@jdub jdub authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/node-router.js
View
8 lib/node-router.js
@@ -148,7 +148,7 @@ exports.getServer = function getServer(logger) {
});
},
destroy: function (req, res, id) {
- delete(data[id]);
+ delete data[id];
on_change(id);
res.simpleJson(200, "200 Destroyed");
}
@@ -224,7 +224,11 @@ exports.getServer = function getServer(logger) {
});
req.addListener('end', function () {
if (route.format === 'json') {
- body = JSON.parse(unescape(body));
+ try {
+ body = JSON.parse(unescape(body));
+ } catch(e) {
+ body = null;
+ }
}
match.push(body);
route.handler.apply(null, match);
Please sign in to comment.
Something went wrong with that request. Please try again.