Skip to content
Myr

refactored `res.redirect()` with `req.protocol()`

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

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent 2ba343d · Browse files · 1 file+2 added−5 removed
This commit

State

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

Diff stats

1 file+2 added−5 removed

  • other:+2 added−5 removed

1 file+2 added−5 removed

modified:lib/response.js+2 added-5 removed
483 unmodified lines
484 url = path + '/' + url;485 }486487 // Absolute488 var host = req.header('Host')489 , proto = req.header('X-Forwarded-Proto')490 , tls = 'https' == proto || req.secure;491492 url = 'http' + (tls ? 's' : '') + '://' + host + url;488 var host = req.header('Host');489 url = req.protocol(true) + '://' + host + url;490 }491492 // Support text/{plain,html} by default493 if (req.accepts('html')) {
83 unmodified lines