Skip to content

Commit

Permalink
feat: default to use proxy preview at telegra.ph
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Mar 11, 2024
1 parent a941227 commit 7ed8222
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/adaptors/api/telegraph/telegraphApiAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ class TelegraphApiAdaptor extends BaseBlogApi {
const postMeta = JsonUtil.safeParse<any>(postid, {})
const purl = this.cfg.previewUrl ?? ""
const postUrl = purl.replace("[postid]", postMeta?.path ?? "")
const useProxyPreview = true
if (useProxyPreview && !StrUtil.isEmptyString(this.cfg.corsAnywhereUrl)) {
const proxyHome = StrUtil.pathJoin(this.cfg.corsAnywhereUrl, this.cfg.home ?? "")
return StrUtil.pathJoin(`${proxyHome}`, postUrl)
}
return postUrl
}

Expand Down

0 comments on commit 7ed8222

Please sign in to comment.