码迷,mamicode.com
首页 > Web开发 > 详细

Mixed Content: xxx This request has been blocked; the content must be served over HTTPS.

时间:2018-05-22 20:38:28      阅读:14454      评论:0      收藏:0      [点我收藏+]

标签:如何   hacker   new   this   targe   openapi   upgrade   nap   isa   

在升级https的过程中,出现如下问题:

Mixed Content: The page at ‘https://www.xxx.com/denglu.html‘ was loaded over HTTPS, but requested an insecure script ‘http://qzonestyle.gtimg.cn/qzone/openapi/qc-1.0.1.js‘. This request has been blocked; the content must be served over HTTPS.

 技术分享图片

 

问题抛出:如何在HTTPS 网页中引入HTTP资源: Mixed Content?

问题原因:HTTPS页面里动态的引入HTTP资源,比如引入一个js文件,会被直接block掉的.在HTTPS页面里通过AJAX的方式请求HTTP资源,也会被直接block掉的。

解决方案:

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

可以在相应的页面的<head>里加上这句代码,意思是自动将http的不安全请求升级为https

参考:https://thehackernews.com/2015/04/disable-mixed-content-warning.html

 

技术分享图片

技术分享图片

技术分享图片

 

Mixed Content: xxx This request has been blocked; the content must be served over HTTPS.

标签:如何   hacker   new   this   targe   openapi   upgrade   nap   isa   

原文地址:https://www.cnblogs.com/joshua317/p/9073633.html

(10)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!