Skip to content

Commit

Permalink
deps: statuses@2.0.1
Browse files Browse the repository at this point in the history
closes #4336
  • Loading branch information
3imed-jaberi authored and dougwilson committed Apr 3, 2022
1 parent 1df7576 commit 980d881
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ unreleased
- deps: statuses@2.0.1
* deps: serve-static@1.15.0
- deps: send@0.18.0
* deps: statuses@2.0.1
- Remove code 306
- Rename `425 Unordered Collection` to standard `425 Too Early`

4.17.3 / 2022-02-16
===================
Expand Down
8 changes: 4 additions & 4 deletions lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ res.send = function send(body) {

deprecate('res.send(status): Use res.sendStatus(status) instead');
this.statusCode = chunk;
chunk = statuses[chunk]
chunk = statuses.message[chunk]
}

switch (typeof chunk) {
Expand Down Expand Up @@ -367,7 +367,7 @@ res.jsonp = function jsonp(obj) {
*/

res.sendStatus = function sendStatus(statusCode) {
var body = statuses[statusCode] || String(statusCode)
var body = statuses.message[statusCode] || String(statusCode)

this.statusCode = statusCode;
this.type('txt');
Expand Down Expand Up @@ -955,12 +955,12 @@ res.redirect = function redirect(url) {
// Support text/{plain,html} by default
this.format({
text: function(){
body = statuses[status] + '. Redirecting to ' + address
body = statuses.message[status] + '. Redirecting to ' + address
},

html: function(){
var u = escapeHtml(address);
body = '<p>' + statuses[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>'
body = '<p>' + statuses.message[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>'
},

default: function(){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"send": "0.18.0",
"serve-static": "1.15.0",
"setprototypeof": "1.2.0",
"statuses": "~1.5.0",
"statuses": "2.0.1",
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
Expand Down

0 comments on commit 980d881

Please sign in to comment.