Skip to content

Conversation

@bjohansebas
Copy link
Member

closes #1834

@bjohansebas bjohansebas added docs Issues/pr concerning content 5.x Docs for 5.x version 4.x Docs for 4.x version labels Mar 15, 2025
@bjohansebas bjohansebas requested review from a team as code owners March 15, 2025 20:35
@netlify
Copy link

netlify bot commented Mar 15, 2025

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 7c7bc45
🔍 Latest deploy log https://app.netlify.com/sites/expressjscom-preview/deploys/67d5e72eb50e5d000816bb12
😎 Deploy Preview https://deploy-preview-1835--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines -48 to -54
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')
```

Copy link
Member Author

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') || '/'

Copy link
Member

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

@bjohansebas bjohansebas changed the title docs: add deprecation note for 'back' redirect in res-redirect.md v4 docs: add deprecation note for 'back' redirect in res-redirect.md and res-location.md v4 Mar 15, 2025
@carlosstenzel carlosstenzel merged commit 748c40e into gh-pages Mar 21, 2025
7 checks passed
@bjohansebas bjohansebas deleted the redirect branch March 31, 2025 18:22
Comment on lines -13 to -15
See also [Security best practices: Prevent open redirect
vulnerabilities](http://expressjs.com/en/advanced/best-practice-security.html#prevent-open-redirects).

Copy link
Contributor

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?

Copy link
Member Author

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).

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

Labels

4.x Docs for 4.x version 5.x Docs for 5.x version docs Issues/pr concerning content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove reference to res.redirect('back').

4 participants