Commit 65293a0
fix(community): OG 封面加 referrerPolicy no-referrer 规避微信防盗链 (#316)
微信 mmbiz.qpic.cn(以及知乎 pic* / 小红书 ci.xiaohongshu.com)对图片请求检查
Referer,非 mp.weixin.qq.com 来源直接返回"此图片来自微信公众平台未经允许不可
使用"的裂图。不发 Referer 时反而放行(微信客户端打开文章时浏览器也不发)。
改动:
- LinkCard: <img> 加 referrerPolicy="no-referrer"
- /admin/community: 原来的 next/image 改成 <img> + referrerPolicy
(顺手规避 next/image remotePatterns 对任意外站域名的限制——Copilot CR 之前
指出过,当时用 unoptimized 绕过,现在统一切 <img> 更干净)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>1 parent cd14662 commit 65293a0
2 files changed
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
133 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | | - | |
| 138 | + | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 142 | + | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
0 commit comments