一、问题出现场景

项目从http升级到https后,jsp页面存在发送http请求的情况下就会出现该异常。因为HTTPS 是 HTTP over Secure Socket Layer,以安全为目标的 HTTP 通道,所以在 HTTPS 承载的页面上不允许出现 http 请求。

二、解决办法

在jsp页面中,添加下面的meta头就可以了

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

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
</head>
<body>
<script type="text/javascript">
</script>
</body>
</html>

【Https异常】This request has been blocked; the content must be served over HTTPS的更多相关文章

  1. 在普通网页显示正常,加Https报This request has been blocked; the content must be served over HTTPS.,https网站加载http资源时,http资源被block

    解决办法 :在html头加<meta http-equiv="Content-Security-Policy" content="upgrade-insecure- ...

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

    在升级https的过程中,出现如下问题: Mixed Content: The page at 'https://www.xxx.com/denglu.html' was loaded over HT ...

  3. https下 http的会被阻塞 This request has been blocked; the content must be served over HTTPS.

    如何在HTTPS 网页中引入HTTP资源: Mixed Content? https://segmentfault.com/q/1010000005872734/a-1020000005874533 ...

  4. This request has been blocked; the content must be served over HTTPS.处理方案

    在页面head标签中加入 <meta http-equiv="Content-Security-Policy" content="upgrade-insecure- ...

  5. 网页中嵌入百度地图报错:The request has been blocked,the content must served over Https

    网页中嵌入百度地图 1.进入百度地图开发平台:http://lbsyun.baidu.com/index.php?title=jspopular 2.获取密钥:http://lbsyun.baidu. ...

  6. Cross-origin plugin content from must have a visible size larger than 400 x 300 pixels, or it will be blocked. Invisible content is always blocked.

    Cross-origin plugin content from  must have a visible size larger than 400 x 300 pixels, or it will ...

  7. (七)VMware Harbor 问题:Get https://192.168.3.135:8088/v2/: http:server gave HTTP response to HTTPS client

    (一)问题描述 登陆时,报错 docker Get https://192.168.3.135:8088/v2/: http:server gave HTTP response to HTTPS cl ...

  8. This content should also be served over HTTPS

    HTTPS 是 HTTP over Secure Socket Layer,以安全为目标的 HTTP 通道,所以在 HTTPS 承载的页面上不允许出现 http 请求,一旦出现就是提示或报错: jqu ...

  9. @RequestBody对象为空,异常Required request body is missing错误解决

    1.异常 org.springframework.http.converter.HttpMessageNotReadableException: Required request body is mi ...

随机推荐

  1. jar包要读取的资源文件路径问题

    本地调试读取文件没有问题 获取 Thread.currentThread().getContextClassLoader().getPath() 读取文件 打jar包之后 获取的路径出错 不能读取文件 ...

  2. 集合系列 Map(十四):WeakedHashMap

    WeakedHashMap 也是 Map 集合的哈希实现,但其余 HashMap 的不同之处在于.其每个节点的 value 引用是弱引用,可以方便 GC 回收. public class WeakHa ...

  3. C# -- 使用ODBC连接数据库

    C# -- 使用ODBC连接数据库 public class ODBCHelper { public static string conString1 = "Dsn=sqlServerDsn ...

  4. (转)两种高效过滤敏感词算法--DFA算法和AC自动机算法

    原文:https://blog.csdn.net/u013421629/article/details/83178970 一道bat面试题:快速替换10亿条标题中的5万个敏感词,有哪些解决思路? 有十 ...

  5. 如何用web3部署智能合约

    合约示例 pragma solidity ^0.4.18; contract CallMeChallenge { bool public isComplete = false; function ca ...

  6. MySQL数据库:数据完整性及约束的应用

    数据完整性 1.域完整性:---------匹配完整性:非空.缺省 字段/列 2.实体完整性:-------匹配完整性:主键.唯一键 记录/行 3.引用完整性:-------匹配完整性:外键 表与表之 ...

  7. thinkphp6安装报错,composer install tp6 报错 Parse error: syntax error

    composer install thinkphp6 报错 Parse error: syntax error, unexpected ':', expecting '{' in vendor\top ...

  8. 附003.Kubeadm部署Kubernetes

    一 kubeadm介绍 1.1 概述 Kubeadm 是一个工具,它提供了 kubeadm init 以及 kubeadm join 这两个命令作为快速创建 kubernetes 集群的最佳实践. k ...

  9. Java之String类

    String类概述 java.lang.String 类代表字符串.Java程序中所有的字符串文字(例如 "abc" )都可以被看作是实现此类的实例.其实就是说:程序当中所有的双引 ...

  10. 多次调用settimeout 如何使用单例模式

    <script> function aaa() { window.counter = window.counter||1; console.log(window.counter); win ...