Skip to content
Myr

refactored res.redirect() with res.req.header() for referrer

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 68fd658 · Browse files · 2 files+5 added−3 removed
This commit

State

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

Diff stats

2 files+5 added−3 removed

  • other:+5 added−3 removed

2 files+5 added−3 removed

modified:lib/request.js+3 added-1 removed
55 unmodified lines
56req.header = function(name, defaultValue){57 switch (name = name.toLowerCase()) {58 case 'referer':59 case 'referrer':60 return this.headers.referrer || this.headers.referer || defaultValue;60 return this.headers.referrer61 || this.headers.referer62 || defaultValue;63 default:64 return this.headers[name] || defaultValue;65 }66};
224 unmodified lines
modified:lib/response.js+2 added-2 removed
339 unmodified lines
340 , body;341342 // Setup redirect map343 var map = {344 back: this.req.headers.referrer || this.req.headers.referer || basePath,345 home: basePath344 back: this.req.header('Referrer', basePath)345 , home: basePath346 };347348 // Support custom redirect map349 map.__proto__ = this.app.redirects;
39 unmodified lines