Skip to content

Commit

Permalink
fix: handle images served without Content-Type
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfbecker committed Feb 13, 2021
1 parent 68588a4 commit e0337e6
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ export async function inlineResources(element: Element): Promise<void> {
const blob = await withTimeout(10000, `Timeout fetching ${element.href.baseVal}`, () =>
fetchResource(element.href.baseVal)
)
if (!blob.type.startsWith('image/')) {
throw new Error(
`Invalid response type inlining <image href="${element.href.baseVal}">: Expected image/* response, got ${blob.type}`
)
}
if (blob.type === 'image/svg+xml') {
// If the image is an SVG, inline it into the output SVG.
// Some tools (e.g. Figma) do not support nested SVG.
Expand Down

0 comments on commit e0337e6

Please sign in to comment.