diff --git a/test/integration/file-serving/test/index.test.js b/test/integration/file-serving/test/index.test.js index cb886b6fd238..7b09bb29cc63 100644 --- a/test/integration/file-serving/test/index.test.js +++ b/test/integration/file-serving/test/index.test.js @@ -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