You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A small, self-hosted Node.js API that discovers real website icons, rejects fake placeholders, and falls back to public icon sources when direct requests fail.
On 2026-07-15, all 12 major Chinese sites and 36 international sites in our sample returned valid images from a mainland China server. The first 28 results all had unique content hashes, so they were not a shared default placeholder. Chinese sites usually work directly; international sites rely more heavily on fallback providers. A cold request for sites such as Google, YouTube, X, or Facebook can take about 10 seconds, while cached responses usually return in tens of milliseconds.
Errors use JSON: `{ "error": "..." }` with `400`, `403`, `404`, or`502` status codes.
86
88
87
89
### `GET /health`
88
90
89
91
```json
90
92
{ "status": "ok" }
91
93
```
92
94
93
-
## 工作原理
95
+
## How it works
94
96
95
-
1.标准化输入 URL,并拒绝内网和保留地址。
96
-
2.短超时抓取网页,手动处理并逐跳检查重定向目的地。
97
-
3.选择网页声明的最佳图标;没有声明时尝试 `/favicon.ico`。
98
-
4.按文件特征验证图片,过滤过小图片与已知占位图。
99
-
5.直连失败时尝试公共兜底源,然后缓存有效结果。
97
+
1.Normalize the input URL and reject private or reserved destinations.
98
+
2.Fetch the page with a short timeout and manually validate every redirect destination.
99
+
3.Select the best icon declared by the page, otherwise try `/favicon.ico`.
100
+
4.Validate the image signature and reject tiny or known placeholder images.
101
+
5.Try public fallback sources when direct discovery fails, then cache the valid result.
100
102
101
-
## 安全与隐私
103
+
## Security and privacy
102
104
103
-
服务会访问用户提交的公开 URL。它会拦截内网、回环、链路本地、文档示例等保留地址,限制重定向次数与响应大小,并重新检查每一个重定向目的地。若生产环境安全等级较高,仍建议配置网络出口规则,以进一步降低 DNS rebinding 风险。
105
+
This service fetches user-supplied public URLs. It blocks private, loopback, link-local, documentation, and other reserved address ranges; limits redirect hops and response sizes; and re-checks each redirect destination. DNS rebinding cannot be eliminated completely without pinning DNS resolution to the outbound connection, so use additional egress controls for high-trust production environments.
Fallback requests may send the requested hostname to `favicone.com`or Yandex. Remove or replace `AGGREGATOR_BUILDERS` in [`src/favicon.js`](src/favicon.js)if your environment must avoid third-party services.
0 commit comments