Skip to content
Myr

Fix res.redirect body when redirect status specified

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

fixes #2402 fixes #2404

authored by Alex Upadhyay · committed by Douglas Christopher Wilson · parent 6f91416 · Browse files · 3 files+33 added−2 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+33 added−2 removed

  • tests:+30 added−0 removed
  • other:+3 added−2 removed

3 files+33 added−2 removed

modified:lib/response.js+2 added-2 removed
816 unmodified lines
817818 // Support text/{plain,html} by default819 this.format({820 text: function(){821 body = statusCodes[status] + '. Redirecting to ' + encodeURI(url);821 body = statusCodes[status] + '. Redirecting to ' + encodeURI(address);822 },823824 html: function(){825 var u = escapeHtml(url);825 var u = escapeHtml(address);826 body = '<p>' + statusCodes[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>';827 },828829 default: function(){
138 unmodified lines
modified:test/res.redirect.js+30 added
modified:History.md+1 added
1unreleased2==========34 * Fix `res.redirect` body when redirect status specified5 * deps: accepts@~1.1.26 - Fix error when media type has invalid parameter7 - deps: negotiator@0.4.98
2348 unmodified lines