File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1414
1515var contentDisposition = require ( 'content-disposition' ) ;
1616var createError = require ( 'http-errors' )
17+ var deprecate = require ( 'depd' ) ( 'express' ) ;
1718var encodeUrl = require ( 'encodeurl' ) ;
1819var escapeHtml = require ( 'escape-html' ) ;
1920var http = require ( 'node:http' ) ;
@@ -826,6 +827,18 @@ res.redirect = function redirect(url) {
826827 address = arguments [ 1 ]
827828 }
828829
830+ if ( ! address ) {
831+ deprecate ( 'Provide a url argument' ) ;
832+ }
833+
834+ if ( typeof address !== 'string' ) {
835+ deprecate ( 'Url must be a string' ) ;
836+ }
837+
838+ if ( typeof status !== 'number' ) {
839+ deprecate ( 'Status must be a number' ) ;
840+ }
841+
829842 // Set location header
830843 address = this . location ( address ) . get ( 'Location' ) ;
831844
Original file line number Diff line number Diff line change 3939 "cookie" : " ^0.7.1" ,
4040 "cookie-signature" : " ^1.2.1" ,
4141 "debug" : " ^4.4.0" ,
42+ "depd" : " ^2.0.0" ,
4243 "encodeurl" : " ^2.0.0" ,
4344 "escape-html" : " ^1.0.3" ,
4445 "etag" : " ^1.8.1" ,
You can’t perform that action at this time.
0 commit comments