Skip to content

Commit

Permalink
update content type logic to check if header includes image/gif rathe…
Browse files Browse the repository at this point in the history
…r than strictly checking for image/gif (#14)

update package.json to match react-gifs/tools name
remove yarn.lock
Co-authored-by: bluematter <[email protected]>
  • Loading branch information
bluematter authored Sep 3, 2021
1 parent be14c4f commit 181601a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse-generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")}"`
);
Expand Down

0 comments on commit 181601a

Please sign in to comment.