New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

res.redirect() #36

Merged
merged 4 commits into from Jul 19, 2012

Conversation

Projects
None yet
3 participants
@yawnt
Contributor

yawnt commented Jul 15, 2012

Fix for #34

I've added ResponseStream.prototype.redirect

Example:

/*
Syntax: res.redirect(url, [method]);
*/

router.get('/foo', function() {
  this.res.redirect('http://www.google.com');
}
router.get('/foo', function() {
  this.res.redirect('/bar', 301);
}

If you want, i can add a body for the redirect like Expresss does.. i haven't included it here because i don't really like the idea (but it's just my two cents)

@jfhbrook

This comment has been minimized.

Show comment
Hide comment
@jfhbrook

jfhbrook Jul 15, 2012

Contributor

Me gusta. Anyone else?

Contributor

jfhbrook commented Jul 15, 2012

Me gusta. Anyone else?

@pksunkara

This comment has been minimized.

Show comment
Hide comment
@pksunkara

pksunkara Jul 16, 2012

Contributor

lgtm

Contributor

pksunkara commented Jul 16, 2012

lgtm

pksunkara added a commit that referenced this pull request Jul 19, 2012

@pksunkara pksunkara merged commit 7d5b565 into flatiron:master Jul 19, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment