Skip to content

Commit b0dff7d

Browse files
morezhoumorezhou
authored andcommitted
Reduce social image edge bundle size
1 parent 654d140 commit b0dff7d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

pages/api/social-image.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import ky from 'ky'
21
import { type NextApiRequest, type NextApiResponse } from 'next'
32
import { ImageResponse } from 'next/og'
43
import { type PageBlock } from 'notion-types'
@@ -277,8 +276,8 @@ async function isUrlReachable(
277276
}
278277

279278
try {
280-
await ky.head(url)
281-
return true
279+
const res = await fetch(url, { method: 'HEAD' })
280+
return res.ok
282281
} catch {
283282
return false
284283
}

0 commit comments

Comments
 (0)