xaoxuu / hexo-theme-stellar

内置文档系统的简约商务风Hexo主题,支持大量的标签组件和动态数据组件。
https://xaoxuu.com/wiki/stellar/
MIT License
1.28k stars 317 forks source link

开启cdn后有一个https报错 #343

Open zbzzh opened 8 months ago

zbzzh commented 8 months ago

1c2d90f62871af32dff27c9bb600a4cf 00d64c39eed69f32e2092c20b6c2b0c3

我设置的是基于80端口的http回源,显示archive是以http方式进行请求的,能否修复一下呢

xaoxuu commented 8 months ago

archive页面都是文字,本身没有用任何外部资源,你检查一下小组件或者页脚有没有引入不安全的链接

zbzzh commented 8 months ago

不是archive里面有非https资源,是我在访问主页的时候就弹出了这个错误,是prefetch中的,应该是预请求走的是http,改为https就可以了,其他没有这个问题

xaoxuu commented 8 months ago

那把预请求关掉试试?

zbzzh commented 8 months ago

怎么关呢,我想预请求呀,能让他走https就好了嘻嘻

zbzzh commented 8 months ago

增加这个标签即可修复

zbzzh commented 8 months ago

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

zbzzh commented 8 months ago

但测试增加此标签会导致普通http请求也转变为https,对http不利,作者看有没有更好的办法,就是预加载那里