Skip to content

Commit f8fd58f

Browse files
committed
fix: load instagram image fail
close #1539
1 parent 0ca5abc commit f8fd58f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

apps/renderer/src/lib/img-proxy.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ export const replaceImgUrlIfNeed = (url?: string) => {
2727
}
2828
}
2929

30-
if (isWebBuild) {
31-
for (const rule of imageRefererMatches) {
32-
if (rule.url.test(url)) {
33-
return getImageProxyUrl({ url, width: 0, height: 0 })
34-
}
30+
for (const rule of imageRefererMatches) {
31+
if ((isWebBuild || rule.force) && rule.url.test(url)) {
32+
return getImageProxyUrl({ url, width: 0, height: 0 })
3533
}
3634
}
3735
return url

packages/shared/src/image.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export const imageRefererMatches = [
2525
},
2626
{
2727
url: /^https:\/\/sp1\.piokok\.com/,
28-
referer: "https://sp1.piokok.com",
28+
referer: "https://www.piokok.com",
29+
force: true,
2930
},
3031
]
3132

0 commit comments

Comments
 (0)