-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
Cleaner way for redirecting back to the Referrer #2692
Conversation
ee5ef6c
to
ddec28b
Compare
As this is a breaking change, though small, I wouldn't mind issuing a deprecation warning and waiting for 5.x instead. |
Seems reasonable to me to remove the magic string value in 5.0 |
The 'back' special case has been moved from res.location() to a new req.back getter. In the future, this will make it possible to redirect to a regular 'back' page.
Changed to emit |
Any update? |
How is this any different than just Sidenote: If we are to keep this I suggest adding a test or two for |
5f268a4
to
9848645
Compare
@dougwilson what should I do? |
I'm all for removing the magic string from Express 5.0, but yes, adding req.back is not a good replacement either, so what to replace it with needs to be thought on more. |
eb10dba
to
340be0f
Compare
Hi @ricordisamoa, taking a look over this I agree with @gabeio's comment and believe we should remove this altogether. The main reasoning is that people should be more aware of blindly using referrer and we should try and direct them toward writing more explicit code, mostly because I realize this is a decade old PR though, so if you're not around I'll take this up and make a new PR in the next week. |
I fully agree @blakeembrey. Maybe in conjunction with removing this we could also add specific docs on how to properly handle this situation? |
I was unable to push to this branch, so I got the tests working and opened a new pr. #5932 |
The 'back' special case has been moved from
res.location()
to a newreq.back
getter. In the future, this will make it possible to redirect to a regular 'back' page.