Skip to content

Commit

Permalink
Fixed res.redirect() HEAD support
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Sep 7, 2011
1 parent 2c734e2 commit d3937b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/response.js
Expand Up @@ -407,6 +407,7 @@ res.redirect = function(url, status){
, req = this.req
, base = app.set('basepath') || app.route
, status = status || 302
, head = 'HEAD' == req.method
, body;

// Setup redirect map
Expand Down Expand Up @@ -449,5 +450,5 @@ res.redirect = function(url, status){
// Respond
this.statusCode = status;
this.header('Location', url);
this.end(body);
this.end(head ? null : body);
};

0 comments on commit d3937b9

Please sign in to comment.