Skip to content
Myr

Refactored `res.header()`

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 c516be8 · Browse files · 2 files+4 added−8 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−8 removed

  • tests:+1 added−2 removed
  • other:+3 added−6 removed

2 files+4 added−8 removed

modified:lib/response.js+3 added-6 removed
254 unmodified lines
255 * @api public256 */257258res.header = function(name, val){259 if (1 == arguments.length) {260 return this.getHeader(name);261 } else {262 this.setHeader(name, val);263 return this;264 }259 if (1 == arguments.length) return this.getHeader(name);260 this.setHeader(name, val);261 return this;262};263264/**265 * Clear cookie `name`.
139 unmodified lines
modified:test/response.test.js+1 added-2 removed
67 unmodified lines
68 res.send({ foo: 'bar' }, 201);69 });70 71 app.get('/text', function(req, res){72 res.header('X-Foo', 'bar');73 res.contentType('txt');72 res.header('X-Foo', 'bar').contentType('txt');73 res.send('wahoo');74 });75 76 app.get('/status', function(req, res){
697 unmodified lines