From 18c6c3b3419578b8fbe42b2ca0c655097c65542f Mon Sep 17 00:00:00 2001 From: paulr Date: Fri, 21 Dec 2012 20:21:03 +1100 Subject: [PATCH] test redirection --- lib/purls/web_body.js | 8 ++++++++ lib/purls/web_nobody.js | 8 ++++++++ lib/purls/web_test.js | 11 +++++++++++ 3 files changed, 27 insertions(+), 0 deletions(-) create mode 100644 lib/purls/web_body.js create mode 100644 lib/purls/web_isbase.js create mode 100644 lib/purls/web_nobody.js create mode 100644 lib/purls/web_test.js 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; -- 1.7.0.4