UNPKG

424 BJavaScriptView Raw
1var task = require ('./base'),
2 util = require ('util');
3
4var redirect = module.exports = function (config) {
5
6 this.init (config);
7
8};
9
10util.inherits (redirect, task);
11
12util.extend (redirect.prototype, {
13
14 run: function () {
15
16 var self = this;
17
18 self.output.statusCode = 303;
19 self.output.setHeader('Location', self.url);
20 // self.output.end('Redirecting to ' + self.url);
21
22 self.completed ();
23 }
24
25});