We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d38eb5b commit 281e115Copy full SHA for 281e115
test/test.js
@@ -580,6 +580,25 @@ describe('serveStatic()', function () {
580
})
581
582
583
+ describe('when non-existent root path', function () {
584
+ var server
585
+ before(function () {
586
+ server = createServer(fixtures + '/does_not_exist')
587
+ })
588
+
589
+ it('should 404 for any file', function (done) {
590
+ request(server)
591
+ .get('/todo.txt')
592
+ .expect(404, done)
593
594
595
+ it('should not allow traversal', function (done) {
596
597
+ .get('/../todo.txt')
598
599
600
601
602
describe('when traversing past root', function () {
603
before(function () {
604
this.server = createServer(fixtures, { fallthrough: false })
0 commit comments