Skip to content

Commit

Permalink
Update utils.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
rishi-raj-jain authored Aug 4, 2024
1 parent 3c27a43 commit 1c95431
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/astro-font/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function getBasePath(src?: string) {
}

export function getRelativePath(from: string, to: string) {
if (to.includes('https')) return to
if (to.includes('https:') || to.includes('http:')) return to
return '/' + relative(from, to)
}

Expand Down Expand Up @@ -97,7 +97,7 @@ export function getPreloadType(src: string) {
// Get the font whether remote or local buffer
async function getFontBuffer(path: string): Promise<Buffer | undefined> {
const fs = await getFS()
if (path.includes('https://')) {
if (path.includes('https:') || path.includes('http:')) {
let tmp = await fetch(path)
return Buffer.from(await tmp.arrayBuffer())
} else {
Expand Down

0 comments on commit 1c95431

Please sign in to comment.