Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

上次僧侣番刮削问题修复产生的后续问题 #184

Open
Jade9nan opened this issue Dec 16, 2024 · 3 comments
Open

上次僧侣番刮削问题修复产生的后续问题 #184

Jade9nan opened this issue Dec 16, 2024 · 3 comments

Comments

@Jade9nan
Copy link

Jade9nan commented Dec 16, 2024

#181

图片

如图,刮削搜索结果的缩略图是类似这样的urlbackground-image:url('http://lain.bgm.tv/pic/cover/l/f5/f8/450_So6Zt.jpg');

如果Jellyfin实例是从localhost或局域网访问可能没问题,但我是用nginx反向代理在个人域名上的,结果这样就触发同源,CSP限制或referer限制了

@Jade9nan
Copy link
Author

Jade9nan commented Dec 16, 2024

浏览器控制台报错内容如下
Content-Security-Policy:由于违反了下列指令:“img-src 'self' https://*”,此页面位于 http://lain.bgm.tv/pic/cover/l/f5/f8/450_So6Zt.jpg 的资源(img-src)无法加载

于是试了下手动编辑DOM,协议从http改成https就能解决↓
<div class="cardImageContainer coveredImage" style="background-image:url('https://lain.bgm.tv/pic/cover/l/f5/f8/450_So6Zt.jpg');"></div>

图片

@kookxiang
Copy link
Owner

很奇怪,看了下这个 302 接口返回本身是 https 的,我自己用也是正常的

https://jellyfin.org/docs/general/networking/nginx/ 试试按官方文档把请求头补充下看看能不能解决?

@Jade9nan
Copy link
Author

Jade9nan commented Dec 17, 2024

很奇怪,看了下这个 302 接口返回本身是 https 的,我自己用也是正常的

https://jellyfin.org/docs/general/networking/nginx/ 试试按官方文档把请求头补充下看看能不能解决?

我原本就是参考Jellyfin官方文档的推荐Nginx设置进行设置的,现在细看似乎有问题
改成下面这样后解决(img-src添加http:协议许可)
add_header Content-Security-Policy "default-src https: data: blob: ; img-src http: https: data: blob:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";

图片

https://files.catbox.moe/azmrka.mp4

但是看搜索结果还是感觉不对劲,前面的5个结果怎么没有缩略图?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants