fix(native): Rust 取字节校验 Content-Type;显示缩略图仅远程走 Rust
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 44s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 44s
This commit is contained in:
1 parent
a7430bb5f2
commit
fd9ed89620
6 files changed
+11
-4
No files matched your search
@@ -61,7 +61,8 @@
|
||||
try { window.IWBPerf && window.IWBPerf.tag('thumb') } catch (e) { /* ignore */ }
|
||||
if (typeof createImageBitmap !== 'function') return false
|
||||
// 2026-12-04(审计 P1):优先宿主注入的 Rust 取字节(远程图不再受 CORS 限制);失败再回退 fetch
|
||||
let blob = (typeof o.fetchBlob === 'function') ? await o.fetchBlob(v) : null
|
||||
// 2026-12-04:只有远程地址才走 Rust;data:/blob: 直接走本地 fetch,避免每次多一次注定失败的 IPC。
|
||||
let blob = (typeof o.fetchBlob === 'function' && /^https?:\/\//i.test(String(v))) ? await o.fetchBlob(v) : null
|
||||
if (!blob || !blob.size) {
|
||||
if (typeof fetch !== 'function') return false
|
||||
const resp = await fetch(v)
|
||||
|
||||
Reference in new issue
Block a user