diff --git a/packages/utils/test/index.spec.js b/packages/utils/test/index.spec.js index d696783d8..c12f8ae34 100644 --- a/packages/utils/test/index.spec.js +++ b/packages/utils/test/index.spec.js @@ -86,4 +86,6 @@ test('is-src', () => { expect(isSrc('img.cdn.com')).toBeFalsy(); expect(isSrc('name')).toBeFalsy(); expect(isSrc('')).toBeFalsy(); + expect(isSrc('blob:http://img.cdn.com')).toBeTruthy(); + expect(isSrc('blob:https://img.cdn.com')).toBeTruthy(); }); diff --git a/packages/utils/validate/src.ts b/packages/utils/validate/src.ts index 9371f0b50..11d6806d2 100644 --- a/packages/utils/validate/src.ts +++ b/packages/utils/validate/src.ts @@ -2,5 +2,5 @@ * Is image source */ export function isSrc(url: string): boolean { - return /^(https?:)?\/\/|data:image/.test(url); + return /^((blob:)?https?:)?\/\/|data:image/.test(url); }