Skip to content

Commit

Permalink
feat: treat data url and blob url as absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
arianrhodsandlot committed Jan 5, 2024
1 parent 24f715c commit ce4aed6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export function isAbsoluteUrl(string: string) {
if (typeof string !== 'string') {
return false
}
return string.startsWith('http://') || string.startsWith('https://') || string.startsWith('//')
const absolutePrefixes = ['http://', 'https://', '//', 'data:', 'blob:']
return absolutePrefixes.some((absolutePrefix) => string.startsWith(absolutePrefix))
}

export async function blobToBuffer(blob: Blob) {
Expand Down

0 comments on commit ce4aed6

Please sign in to comment.