We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
"back"
1 parent 21df421 commit 77ada90Copy full SHA for 77ada90
History.md
@@ -1,3 +1,8 @@
1
+unreleased
2
+==========
3
+
4
+ * Deprecate `res.location("back")` and `res.redirect("back")` magic string
5
6
4.20.0 / 2024-09-10
7
==========
8
* deps: serve-static@0.16.0
lib/response.js
@@ -916,6 +916,7 @@ res.location = function location(url) {
916
917
// "back" is an alias for the referrer
918
if (url === 'back') {
919
+ deprecate('res.location("back"): use res.location(req.get("Referrer") || "/") and refer to https://dub.sh/security-redirect for best practices');
920
loc = this.req.get('Referrer') || '/';
921
} else {
922
loc = String(url);
0 commit comments