Skip to content
Myr

Added `res.header()` and `req.header()` aliases for BC

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 c998b91 · Browse files · 2 files+4 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

2 files+4 added−2 removed

  • other:+4 added−2 removed

2 files+4 added−2 removed

modified:lib/request.js+2 added-1 removed
44 unmodified lines
45 * @return {String} 46 * @api public47 */4849req.get = function(name){49req.get = 50req.header = function(name){51 switch (name = name.toLowerCase()) {52 case 'referer':53 case 'referrer':54 return this.headers.referrer
362 unmodified lines
modified:lib/response.js+2 added-1 removed
391 unmodified lines
392 * @return {ServerResponse} for chaining393 * @api public394 */395396res.set = 396res.set = function(field, val){397res.header = function(field, val){398 if (2 == arguments.length) {399 this.setHeader(field, val);400 } else {401 for (var key in field) {
240 unmodified lines