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

HTTPS页面中转存HTTP协议图片会失效 #1310

Open
Pascal-Lin opened this issue Nov 4, 2024 · 0 comments
Open

HTTPS页面中转存HTTP协议图片会失效 #1310

Pascal-Lin opened this issue Nov 4, 2024 · 0 comments

Comments

@Pascal-Lin
Copy link

Bug 描述

在一个HTTPS页面中,转存HTTP协议的图片到图床会报错。

复现步骤

  1. 打开https://www.sohu.com/a/139069198_792424
  2. 点击“把文章内图片上传到图床”按钮后,控制台会报错。

Mixed Content: The page at 'https://www.sohu.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://img.mp.itc.cn/upload/20170508/59f4ad896cf749f3b6190b83c0a2a2e4_th.jpg'. This request has been blocked; the content must be served over HTTPS.

请填写以下信息

  • 笔记平台: notion
  • 浏览器 Edge

其他背景

以下来自ChatGPT

这个错误提示是因为你正在通过 HTTPS 加载页面,但请求的资源是通过 HTTP 加载的。为了解决这个问题,你可以尝试以下几种方法:
使用 HTTPS 资源:检查请求的 URL,看看是否有 HTTPS 版本的图片资源。
修改代码:如果你有控制权,可以在你的代码中将请求的 URL 改为 HTTPS。
CORS 设置:如果这个资源是第三方的,可能需要联系提供者以确保他们的服务器支持 HTTPS。
本地代理:作为临时解决方案,你可以通过一个本地代理来转发 HTTP 请求,但这不建议用于生产环境。

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

1 participant