Skip to content

Commit

Permalink
deps: send@0.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Sep 29, 2017
1 parent 40d1897 commit 327543b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
unreleased
==========

* Fix regression when `root` is incorrectly set to a file
* deps: send@0.16.1

1.13.0 / 2017-09-27
===================

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"encodeurl": "~1.0.1",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"send": "0.16.0"
"send": "0.16.1"
},
"devDependencies": {
"eslint": "3.19.0",
Expand Down
28 changes: 28 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,34 @@ describe('serveStatic()', function () {
})
})

//
// NOTE: This is not a real part of the API, but
// over time this has become something users
// are doing, so this will prevent unseen
// regressions around this use-case.
//
describe('when mounted "root" as a file', function () {
var server
before(function () {
server = createServer(fixtures + '/todo.txt', null, function (req) {
req.originalUrl = req.url
req.url = '/' + req.url.split('/').slice(2).join('/')
})
})

it('should load the file when on trailing slash', function (done) {
request(server)
.get('/todo')
.expect(200, '- groceries', done)
})

it('should 404 when trailing slash', function (done) {
request(server)
.get('/todo/')
.expect(404, done)
})
})

describe('when responding non-2xx or 304', function () {
var server
before(function () {
Expand Down

0 comments on commit 327543b

Please sign in to comment.