Skip to content

Commit

Permalink
fix: load instagram image fail
Browse files Browse the repository at this point in the history
close #1539
  • Loading branch information
hyoban committed Nov 13, 2024
1 parent 0ca5abc commit f8fd58f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 3 additions & 5 deletions apps/renderer/src/lib/img-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ export const replaceImgUrlIfNeed = (url?: string) => {
}
}

if (isWebBuild) {
for (const rule of imageRefererMatches) {
if (rule.url.test(url)) {
return getImageProxyUrl({ url, width: 0, height: 0 })
}
for (const rule of imageRefererMatches) {
if ((isWebBuild || rule.force) && rule.url.test(url)) {
return getImageProxyUrl({ url, width: 0, height: 0 })
}
}
return url
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/src/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export const imageRefererMatches = [
},
{
url: /^https:\/\/sp1\.piokok\.com/,
referer: "https://sp1.piokok.com",
referer: "https://www.piokok.com",
force: true,
},
]

Expand Down

0 comments on commit f8fd58f

Please sign in to comment.