fix: non standard status code will result in undefined#7045
fix: non standard status code will result in undefined#7045cuiweixie wants to merge 2 commits intoexpressjs:masterfrom
Conversation
erdinccurebal
left a comment
There was a problem hiding this comment.
Good catch — statuses.message[status] returns undefined for non-standard status codes, which results in the redirect body being "undefined. Redirecting to /foo".
The fallback to String(status) makes sense. One thing to note: the html format callback a few lines below has the same pattern:
html: function(){
var u = escapeHtml(address);
body = '<p>' + statuses.message[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>'
},This would also produce "<p>undefined. Redirecting to..." for non-standard codes. Might be worth applying the same fallback there for consistency.
Done |
No description provided.