From 181601add8dcc7ca8352a5bc159163a7929b456d Mon Sep 17 00:00:00 2001 From: Michael Aubry Date: Thu, 2 Sep 2021 23:38:43 -0700 Subject: [PATCH] update content type logic to check if header includes image/gif rather than strictly checking for image/gif (#14) update package.json to match react-gifs/tools name remove yarn.lock Co-authored-by: bluematter --- src/parse-generate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parse-generate.js b/src/parse-generate.js index ffd52f1..0e2f398 100644 --- a/src/parse-generate.js +++ b/src/parse-generate.js @@ -15,7 +15,7 @@ const validateAndFix = (gif) => { export const parse = (src, { signal }) => fetch(src, { signal }) .then((resp) => { - if (resp.headers.get("Content-Type") !== "image/gif") + if (!resp.headers.get("Content-Type").includes("image/gif")) throw Error( `Wrong content type: "${resp.headers.get("Content-Type")}"` );