diff --git a/package-lock.json b/package-lock.json index 8817524..81b3bcc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "favicon-downloader", - "version": "0.2.5.rc", + "version": "0.2.6.rc", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "favicon-downloader", - "version": "0.2.5.rc", + "version": "0.2.6.rc", "dependencies": { "@hookform/resolvers": "^3.9.0", "@next/third-parties": "^14.2.5", diff --git a/package.json b/package.json index 59e10a8..7327826 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "favicon-downloader", - "version": "0.2.5.rc", + "version": "0.2.6.rc", "private": true, "scripts": { "dev": "next dev", diff --git a/src/app/api/favicon/[domain]/route.ts b/src/app/api/favicon/[domain]/route.ts index c7e1706..19e9216 100644 --- a/src/app/api/favicon/[domain]/route.ts +++ b/src/app/api/favicon/[domain]/route.ts @@ -61,7 +61,7 @@ export async function GET(request: NextRequest, { params }: { params: { domain: redirect: 'follow' }); - if (response.status === 200) { + if (response.ok) { icons.push({ href: source, sizes: "unknown" }); } } catch (error) { diff --git a/src/app/favicon/[domain]/route.ts b/src/app/favicon/[domain]/route.ts index 577e8c0..b85cbb9 100644 --- a/src/app/favicon/[domain]/route.ts +++ b/src/app/favicon/[domain]/route.ts @@ -28,7 +28,7 @@ export async function GET(request: NextRequest, { params: { domain } }: { params headers: request.headers, redirect: 'follow' }); - if (response.status === 200) { + if (response.ok) { return response; } } catch (error: any) { diff --git a/src/lib/server.ts b/src/lib/server.ts index d803e7c..b2be1cb 100644 --- a/src/lib/server.ts +++ b/src/lib/server.ts @@ -79,7 +79,7 @@ export const proxyFavicon = async ({ domain, request }: { domain: string; reques headers: request.headers, redirect: 'follow' }); - if (response.status == 200) { + if (response.ok) { break; } @@ -89,7 +89,7 @@ export const proxyFavicon = async ({ domain, request }: { domain: string; reques console.error(`Error fetching proxy favicon: ${error}`); } } - if (response.status !== 200) { + if (!response.ok) { const firstLetter = domain.charAt(0).toUpperCase(); const svgContent = `