From a4097eefa0032381b8b6e24bf8131ad952af18a4 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Wed, 31 Aug 2022 15:34:58 +0800 Subject: [PATCH] test(#40066): add failed test case --- test/integration/file-serving/test/index.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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