Skip to content
Myr

fix res.sendfile regression for serving directory index files

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 767db01 · Browse files · 4 files+30 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

4 files+30 added−1 removed

  • tests:+25 added−0 removed
  • other:+5 added−1 removed

4 files+30 added−1 removed

added:test/fixtures/blog/index.html+1 added
modified:test/res.sendfile.js+24 added
128 unmodified lines
129 .get('/')130 .expect(200, 'tobi', done);131 })132133 it('should transfer a file', function (done) {134 var app = express();135136 app.use(function (req, res) {137 res.sendfile('test/fixtures/name.txt');138 });139140 request(app)141 .get('/')142 .expect(200, 'tobi', done);143 });144145 it('should transfer a directory index file', function (done) {146 var app = express();147148 app.use(function (req, res) {149 res.sendfile('test/fixtures/blog/');150 });151152 request(app)153 .get('/')154 .expect(200, '<b>index</b>', done);155 });156157 describe('with an absolute path', function(){158 it('should transfer the file', function(done){159 var app = express();160
126 unmodified lines
modified:History.md+4 added
13.x2===34 * fix `res.sendfile` regression for serving directory index files5 * deps: connect@2.24.36 - deps: serve-index@~1.1.57 - deps: serve-static@~1.4.48 * deps: send@0.7.49 - Fix incorrect 403 on Windows and Node.js 0.1110 - Fix serving index files without root dir11123.15.2 / 2014-07-2713===================14
1592 unmodified lines
modified:package.json+1 added-1 removed