expressjs / serve-static

Serve static files
MIT License
1.38k stars 227 forks source link

Need support node >= v10.x #123

Closed vanpipy closed 5 years ago

vanpipy commented 5 years ago

node: v10.15.0 npm: 6.4.1

on Travis.

Error message after npm test as below:

 1) serveStatic() fallthrough when true should fall-through when URL too long:
     Error: expected 404 "Not Found", got 400 "Bad Request"
      at Test._assertStatus (node_modules/supertest/lib/test.js:232:12)
      at Test._assertFunction (node_modules/supertest/lib/test.js:247:11)
      at Test.assert (node_modules/supertest/lib/test.js:148:18)
      at Server.assert (node_modules/supertest/lib/test.js:127:12)
      at emitCloseNT (net.js:1609:8)
      at process._tickCallback (internal/process/next_tick.js:63:19)
  2) serveStatic() fallthrough when false should 404 when URL too long:
     Error: expected 404 "Not Found", got 400 "Bad Request"
      at Test._assertStatus (node_modules/supertest/lib/test.js:232:12)
      at Test._assertFunction (node_modules/supertest/lib/test.js:247:11)
      at Test.assert (node_modules/supertest/lib/test.js:148:18)
      at Server.assert (node_modules/supertest/lib/test.js:127:12)
      at emitCloseNT (net.js:1609:8)
      at process._tickCallback (internal/process/next_tick.js:63:19)

Everything is ok when node < v10.x.

dougwilson commented 5 years ago

Looks like the module works fine, just the tests need to be adjusted for a change in the max headers size in Node.js 10+