From 6b783527645f6e433fbcfbb35bc6e2c43fc8e97c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 11 Mar 2013 10:04:44 +0000 Subject: [PATCH] Fixed handling of deleting tiddlers over HTTP --- core/modules/commands/server.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/modules/commands/server.js b/core/modules/commands/server.js index bf9423f2c..8f6370a1b 100644 --- a/core/modules/commands/server.js +++ b/core/modules/commands/server.js @@ -74,10 +74,16 @@ console.log("PUT tiddler",title,fields) }); break; case "DELETE": -console.log("DELETE tiddler",requestPath.substr(1)) -// self.commander.wiki.deleteTiddler(decodeURIComponent(requestPath.substr(1))); - response.writeHead(204, "OK"); - response.end(); + var prefix = "/tiddlers/"; + if(requestPath.indexOf(prefix) === 0) { +console.log("DELETE tiddler",requestPath.substr(prefix.length)) +// self.commander.wiki.deleteTiddler(decodeURIComponent(requestPath.substr(prefix.length))); + response.writeHead(204, "OK"); + response.end(); + } else { + response.writeHead(404); + response.end(); + } break; case "GET": if(requestPath === "/") {