Skip to content

Commit

Permalink
fix: do not sent data urls to provider
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Nov 25, 2020
1 parent 9f252a0 commit 565445f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function createImage (context, { providers, defaultProvider, presets, int
const { modifiers = {} } = options
const isRemote = isRemoteUrl(src)

if (isRemote && !allow.accept(src)) {
if ((isRemote && !allow.accept(src)) || src.startsWith('data:')) {
return {
src,
provider: null,
Expand Down
3 changes: 3 additions & 0 deletions test/fixture/base/pages/dataurl.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<nuxt-img alt="star" src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" />
</template>

0 comments on commit 565445f

Please sign in to comment.