diff --git a/src/index.js b/src/index.js index bd85666..b8ed018 100644 --- a/src/index.js +++ b/src/index.js @@ -62,7 +62,7 @@ const fetch = PCancelable.fn( return contentType.startsWith('text/html') || !isMediaUrl(url) ? await toEncode(res.body, res.headers['content-type']) - : res.body + : res.body.toString() })() return { diff --git a/test/index.js b/test/index.js index 732413a..8334899 100644 --- a/test/index.js +++ b/test/index.js @@ -132,6 +132,13 @@ test('from image URL', async t => { t.snapshot(prettyHtml($.html())) }) +test('from SVG image URL', async t => { + const targetUrl = 'https://cdn.microlink.io/file-examples/sample.svg' + const { stats } = await getHTML(targetUrl, { getBrowserless }) + t.true(stats.timing < 3000) + t.is(stats.mode, 'fetch') +}) + test('from big image URL', async t => { const targetUrl = 'https://static.jutarnji.hr/images/live-multimedia/binary/2016/6/17/10/iStock_82744687_XXLARGE.jpg'