Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Adding Status Code Parameter #849

Merged
merged 2 commits into from Nov 16, 2017
Merged

Conversation

KraFusion
Copy link
Contributor

chaining status() and redirect() does not work, I believe the redirect defaults to 302 and overwrites whatever status is set in the status() part of the chain. Switching to the method documented in express works. This document will now match closer to what express has documented . https://expressjs.com/en/4x/api.html#res.redirect

KraFusion and others added 2 commits April 5, 2017 23:56
chaining status() and redirect() does not work, I believe the redirect defaults to 302 and overwrites whatever status is set in the status() part of the chain. Switching to the method documented in express works. This document will now match closer to what express has documented . https://expressjs.com/en/4x/api.html#res.redirect
@sgress454
Copy link
Member

Thanks @KraFusion !

@sgress454 sgress454 merged commit 755ebb2 into balderdashy:master Nov 16, 2017
@mikermcneil
Copy link
Member

@KraFusion Just to be clear, does res.status(301).redirect('…') not work?

@mikermcneil
Copy link
Member

@KraFusion and if that's the case, then would you also resubmit this PR on the 1.0 branch? Thanks a lot!

@sgress454
Copy link
Member

@mikermcneil It definitely doesn't work!

@KraFusion
Copy link
Contributor Author

@mikermcneil @sgress454 PR #943 has been submitted for the 1.0 branch.
I double checked that res.status(301).redirect('…') does indeed ignore the status code and sends a 302 instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants