mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-08 14:26:37 +08:00
fix: 增强站点连接测试HTTP请求头,添加浏览器仿真与FlareSolverr支持
- 新增 internal/helper/http.go:带浏览器仿真请求头和Cloudflare/WAF绕过支持 - TestSiteConnectivity 支持 FlareSolverr 代理(需配置 flareSolverrUrl) - 检测 Cloudflare challenge 页面并返回友好错误信息 - 重构 service/site.go TestConnection 使用新的 helper 方法
This commit is contained in:
@@ -49,3 +49,9 @@ func SiteTypes() []string {
|
||||
func AuthTypes() []string {
|
||||
return []string{"cookie", "api_key", "auth_header"}
|
||||
}
|
||||
|
||||
// DefaultUserAgent 是默认浏览器 User-Agent(用于 HTTP 请求头)。
|
||||
const DefaultUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
|
||||
|
||||
// SiteTypes 返回支持的站点类型列表(用于前端下拉)。
|
||||
// 注意:此函数供 API 返回类型列表使用,不在此处添加新类型。
|
||||
|
||||
Reference in New Issue
Block a user