🎨 Add TLS browser fingerprint implementation (#14934)

Resolves: siyuan-note/siyuan#14933
This commit is contained in:
DDD-HHY 2025-05-29 18:04:50 +08:00 committed by GitHub
parent cf8acfa633
commit f535a13372
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 95 additions and 6 deletions

View file

@ -38,7 +38,6 @@ import (
"github.com/88250/lute/html"
"github.com/88250/lute/parse"
"github.com/gabriel-vasile/mimetype"
"github.com/imroc/req/v3"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/httpclient"
"github.com/siyuan-note/logging"
@ -101,11 +100,8 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
}
}
browserClient := req.C().
SetUserAgent(util.UserAgent).
SetTimeout(30 * time.Second).
EnableInsecureSkipVerify().
SetProxy(httpclient.ProxyFromEnvironment)
browserClient := util.CreateCustomReqClient().
EnableInsecureSkipVerify() // 添加了自定义TLS指纹, 可以完成对于CDN的资源下载
forbiddenCount := 0
destNodes := getRemoteAssetsLinkDestsInTree(tree, onlyImg)