Skip to content

Commit

Permalink
test(vercel#40066): add failed test case
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Aug 31, 2022
1 parent 591f341 commit a4097ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/integration/file-serving/test/index.test.js
Expand Up @@ -68,6 +68,16 @@ const runTests = () => {
expect(res.headers.get('content-type')).toBe('image/avif')
})

it('should serve correct error code', async () => {
// vercel-icon-dark.avif is downloaded from https://vercel.com/design and transformed to avif on avif.io
const res = await fetchViaHTTP(appPort, '/vercel-icon-dark.avif', '', {
headers: {
Range: 'bytes=1000000000-',
},
})
expect(res.status).toBe(416) // 416 Range Not Satisfiable
})

// checks against traversal requests from
// https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Directory%20Traversal/Intruder/traversals-8-deep-exotic-encoding.txt

Expand Down

0 comments on commit a4097ee

Please sign in to comment.