From: paulr Date: Fri, 21 Dec 2012 09:21:03 +0000 (+1100) Subject: test redirection X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=18c6c3b3419578b8fbe42b2ca0c655097c65542f;p=nodejsws.git test redirection --- diff --git a/lib/purls/web_body.js b/lib/purls/web_body.js new file mode 100644 index 0000000..c9671ed --- /dev/null +++ b/lib/purls/web_body.js @@ -0,0 +1,8 @@ +function process(request, response, callback) { + response.write("Body"); + callback(request, response); +} + + +exports.process = process; +exports.requireBody = function() { return true;}; diff --git a/lib/purls/web_isbase.js b/lib/purls/web_isbase.js new file mode 100644 index 0000000..e69de29 diff --git a/lib/purls/web_nobody.js b/lib/purls/web_nobody.js new file mode 100644 index 0000000..67eef07 --- /dev/null +++ b/lib/purls/web_nobody.js @@ -0,0 +1,8 @@ +function process(request, response, callback) { + response.writeHead(302, { 'Location':'/body/'}) + callback(request, response); +} + + +exports.process = process; +exports.requireBody = function() { return false;}; diff --git a/lib/purls/web_test.js b/lib/purls/web_test.js new file mode 100644 index 0000000..e746be5 --- /dev/null +++ b/lib/purls/web_test.js @@ -0,0 +1,11 @@ +function requireBody() { + return true; +} + +function process(request, response, callback) { + response.write("from callback
"); + callback(request, response); +} + +exports.requireBody = requireBody; +exports.process = process;