Skip to content
Myr

Fix wrong code on aborted connections from res.sendFile

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

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 31cb541 · Browse files · 3 files+6 added−5 removed
This commit

State

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

Diff stats

3 files+6 added−5 removed

  • tests:+4 added−4 removed
  • other:+2 added−1 removed

3 files+6 added−5 removed

modified:lib/response.js+1 added-1 removed
947 unmodified lines
948 if (done) return;949 done = true;950951 var err = new Error('Request aborted');952 err.code = 'ECONNABORT';952 err.code = 'ECONNABORTED';953 callback(err);954 }955956 // directory
73 unmodified lines
modified:test/res.sendFile.js+4 added-4 removed
205 unmodified lines
206 app.use(function (req, res) {207 setImmediate(function () {208 res.sendFile(path.resolve(fixtures, 'name.txt'), function (err) {209 should(err).be.ok;210 err.code.should.equal('ECONNABORT');210 err.code.should.equal('ECONNABORTED');211 cb();212 });213 });214 test.abort();
10 unmodified lines
225 app.use(function (req, res) {226 onFinished(res, function () {227 res.sendFile(path.resolve(fixtures, 'name.txt'), function (err) {228 should(err).be.ok;229 err.code.should.equal('ECONNABORT');229 err.code.should.equal('ECONNABORTED');230 cb();231 });232 });233 test.abort();
88 unmodified lines
322 app.use(function (req, res) {323 setImmediate(function () {324 res.sendfile('test/fixtures/name.txt', function (err) {325 should(err).be.ok;326 err.code.should.equal('ECONNABORT');326 err.code.should.equal('ECONNABORTED');327 cb();328 });329 });330 test.abort();
10 unmodified lines
341 app.use(function (req, res) {342 onFinished(res, function () {343 res.sendfile('test/fixtures/name.txt', function (err) {344 should(err).be.ok;345 err.code.should.equal('ECONNABORT');345 err.code.should.equal('ECONNABORTED');346 cb();347 });348 });349 test.abort();
383 unmodified lines
modified:History.md+1 added
2 unmodified lines
34 * Fix constructing application with non-configurable prototype properties5 * Fix `req.host` when using "trust proxy" hops count6 * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count7 * Fix wrong `code` on aborted connections from `res.sendFile`8 * deps: merge-descriptors@1.0.09104.12.0 / 2015-02-2311===================
2700 unmodified lines