Skip to content

Conversation

@vini4721
Copy link

@vini4721 vini4721 commented Dec 2, 2025

Fixes #1834

Changes

  • Removed deprecated res.redirect('back') example from Express 3.x API documentation
  • Removed deprecated res.redirect('back') example and deprecation notice from Express 4.x API documentation

Reason

The res.redirect('back') method was deprecated in Express 4.x and completely removed in Express 5.x. These examples should no longer appear in the API documentation as they may confuse users.

Related

  • The migration guides correctly explain that 'back' is no longer supported and recommend using req.get('Referrer') || '/' instead
  • Express 5.x documentation already does not include this deprecated example

@vini4721 vini4721 requested a review from a team as a code owner December 2, 2025 07:43
@netlify
Copy link

netlify bot commented Dec 2, 2025

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 363c818
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/692ffcb4d6ae6000083f95d0
😎 Deploy Preview https://deploy-preview-2126--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 project configuration.

@krzysdz
Copy link
Contributor

krzysdz commented Dec 2, 2025

Deprecated API should be marked as such (and it is), not removed from documentation if it still exists. It was removed from Express 5 docs, because it does not exist in Express 5. If you see somewhere in old code res.redirect('back'), you may want to check in the documentation what does it do. If the documentation is removed, it will be very confusing for users.

Your PR not only removes documentation for a feature that still exists (talking about Express 4), but also the recommendation how to replace it.

@vini4721
Copy link
Author

vini4721 commented Dec 3, 2025

Thank you for the feedback @krzysdz! I understand the issue now.

I need clarification: Issue #1834 mentions that res.redirect('back') appears in the Express 5 API documentation. However, when I searched the repository, I found it in the 3.x and 4.x files:

  • _includes/api/en/3x/res-redirect.md
  • _includes/api/en/4x/res-redirect.md

I did NOT find a separate 5.x API documentation file for res.redirect().

Could you please point me to which specific file contains the Express 5 API reference that needs to be updated? I want to fix this correctly by only removing it from Express 5 docs while keeping it in 3.x/4.x docs where it's properly marked as deprecated.

The deprecated feature should remain documented in Express 3.x and 4.x
where it still exists. Only Express 5 removed this feature.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

🚦 Lighthouse Results (Mobile & Desktop)

URL Device Perf A11y Best Practices
/ mobile 🔴 62 🟢 100 🟢 96
/en/blog/posts.html mobile 🟠 78 🟢 96 🟢 92
/en/5x/api.html mobile 🟢 97 🟢 95 🟢 96
/ desktop 🟢 100 🟢 100 🟢 96
/en/blog/posts.html desktop 🟢 100 🟢 96 🟢 92
/en/5x/api.html desktop 🟢 99 🟢 95 🟢 96

@krzysdz
Copy link
Contributor

krzysdz commented Dec 3, 2025

The 5.x documentation for res.redirect() is under _includes/api/en/5x/res-redirect.md and the issue #1834 was fixed by PR #1835 almost 9 months ago. If you're looking for problems to fix, closed issues aren't the best place to start.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants