From 91951433ac7fe08579b402d4862110bce3eb2eb7 Mon Sep 17 00:00:00 2001 From: Todd Evanoff Date: Fri, 15 Dec 2023 13:26:13 -0800 Subject: [PATCH] case-insensitive match on header name --- src/resource-archive/index.test.ts | 6 +++--- src/resource-archive/index.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/resource-archive/index.test.ts b/src/resource-archive/index.test.ts index 8a4213c6..8b99760b 100644 --- a/src/resource-archive/index.test.ts +++ b/src/resource-archive/index.test.ts @@ -129,7 +129,7 @@ describe('new', () => { statusCode: 200, statusText: 'OK', body: Buffer.from(imgPng, 'base64'), - contentType: undefined, + contentType: 'image/png', }, }); }); @@ -155,7 +155,7 @@ describe('new', () => { statusCode: 200, statusText: 'OK', body: Buffer.from(imgPng, 'base64'), - contentType: undefined, + contentType: 'image/png', }, }); }); @@ -195,7 +195,7 @@ describe('new', () => { statusCode: 200, statusText: 'OK', body: Buffer.from(imgPng, 'base64'), - contentType: undefined, + contentType: 'image/png', }, // includes cross-origin images 'https://i-ama.fake/external/domain/image.png': { diff --git a/src/resource-archive/index.ts b/src/resource-archive/index.ts index d03ff3cd..a6cf9975 100644 --- a/src/resource-archive/index.ts +++ b/src/resource-archive/index.ts @@ -184,7 +184,7 @@ class Watcher { // If the Content-Type header is present, let's capture it. const contentTypeHeader: Protocol.Fetch.HeaderEntry = responseHeaders.find( - ({ name }) => name === 'Content-Type' + ({ name }) => name.toLowerCase() === 'content-type' ); // No need to capture the response of the top level page request