Skip to content
Myr

res.send() HEAD support

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 15dffb2 · Browse files · 2 files+13 added−1 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+13 added−1 removed

  • tests:+12 added−0 removed
  • other:+1 added−1 removed

2 files+13 added−1 removed

modified:lib/express/response.js+1 added-1 removed
108 unmodified lines
109 }110111 // Respond112 this.writeHead(status, this.headers);113 this.end(body);113 this.end('HEAD' == this.req.method ? undefined : body);114};115116/**117 * Transfer the file at the given `path`. Automatically sets
201 unmodified lines
modified:test/response.test.js+12 added
271 unmodified lines
272 assert.equal(273 'rememberme=; expires=Thu, 01 Jan 1970 00:00:00 GMT',274 res.headers['set-cookie'][0]);275 });276 },277 278 'test HEAD': function(assert){279 var app = express.createServer();280 281 app.get('/', function(req, res, next){282 res.send('Hello World');283 });284 285 assert.response(app,286 { url: '/', method: 'HEAD' },287 { body: '', headers: { 'Content-Length': 11 }});288 }289};