-
-
Notifications
You must be signed in to change notification settings - Fork 2k
docs: add deprecation note for 'back' redirect in res-redirect.md and res-location.md v4 #1835
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
Conversation
✅ Deploy Preview for expressjscom-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| A `back` redirection redirects the request back to the [referer](http://en.wikipedia.org/wiki/HTTP_referer), | ||
| defaulting to `/` when the referer is missing. | ||
|
|
||
| ```js | ||
| res.redirect('back') | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about removing this, maybe the recommended option should be mentioned req.get('Referrer') || '/'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to 5x migration guide
| See also [Security best practices: Prevent open redirect | ||
| vulnerabilities](http://expressjs.com/en/advanced/best-practice-security.html#prevent-open-redirects). | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this note was removed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can keep it—there's no reason to remove it. Also, we still need to add the reference to the new recommended option (see https://github.com/expressjs/expressjs.com/pull/1835/files#r1997311521).
closes #1834