Skip to content

Commit

Permalink
update status
Browse files Browse the repository at this point in the history
  • Loading branch information
seadfeng committed Sep 4, 2024
1 parent 8b75673 commit add8815
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "favicon-downloader",
"version": "0.2.5.rc",
"version": "0.2.6.rc",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/favicon/[domain]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/favicon/[domain]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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 = `
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
Expand Down

0 comments on commit add8815

Please # to comment.