Skip to content
Myr

Remove res.redirect(url, status) signature

Before adoption: this commit came in with the history the project adopted, so no landing records it.

closes #2941

authored by Mike Tunnicliffe · committed by Douglas Christopher Wilson · parent e3bd14d · Browse files · 3 files+3 added−23 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+3 added−23 removed

  • tests:+0 added−15 removed
  • other:+3 added−8 removed

3 files+3 added−23 removed

modified:lib/response.js+2 added-8 removed
11 unmodified lines
12 * @private13 */1415var contentDisposition = require('content-disposition');16var deprecate = require('depd')('express');16var encodeUrl = require('encodeurl');17var escapeHtml = require('escape-html');18var http = require('http');19var onFinished = require('on-finished');
723 unmodified lines
743 var status = 302;744745 // allow status / url746 if (arguments.length === 2) {748 if (typeof arguments[0] === 'number') {749 status = arguments[0];750 address = arguments[1];747 status = arguments[0]748 address = arguments[1]751 } else {752 deprecate('res.redirect(url, status): Use res.redirect(status, url) instead');753 status = arguments[1];754 }749 }750751 // Set location header752 address = this.location(address).get('Location');
185 unmodified lines
modified:test/res.redirect.js-15 removed
modified:History.md+1 added
2 unmodified lines
34This incorporates all changes after 4.15.2 up to 4.15.4.56 * remove:7 - `res.redirect(url, status)` signature - use `res.redirect(status, url)`8 - `res.send(status, body)` signature - use `res.status(status).send(body)`9 * deps: router@~1.3.110 - deps: debug@2.6.811
3367 unmodified lines