Skip to content
Myr

Added Request#sendHead()

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

authored by visionmedia · committed by visionmedia · parent 26b3a42 · Browse files · 1 file+14 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

1 file+14 added−2 removed

  • other:+14 added−2 removed

1 file+14 added−2 removed

modified:lib/express/request.js+14 added-2 removed
197 unmodified lines
198 // TODO: revisit. when this is true node will add Transfer-Encoding: chunked199 // along with a response body, which is not ideal when the user attemps200 // to respond with no body201 if (!body) self.response.useChunkedEncodingByDefault = false202 self.response.writeHead(self.response.status, self.response.headers)202 self.sendHead()203 if (body) self.response.write(self.response.body, encoding)204 self.response.end()205 }, true)206 },
22 unmodified lines
229 first = false230 self.header('Transfer-Encoding', 'chunked')231 self.status(200)232 self.contentType(stream.path)233 self.response.writeHead(self.response.status, self.response.headers)233 self.sendHead()234 }235 self.response.write(data, 'binary')236 })237 .addListener('end', function(){
8 unmodified lines
246 })247 },248 249 /**250 * Send the response header.251 *252 * @return {Request}253 * @api public254 */255 256 sendHead: function(){257 this.response.writeHead(this.response.status, this.response.headers)258 return this259 },260 261 /**262 * Pass control to the next matching route, or263 * the given _path_.264 *265 * NOTE: _path_ may be the request pathname only,
142 unmodified lines