【Https异常】This request has been blocked; the content must be served over HTTPS

一、问题出现场景

项目从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://www.cnblogs.com/756623607-zhang/p/11790283.html

时间: 2024-10-09 04:49:59

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

在普通网页显示正常,加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-requests">问题解决 原文地址:https://www.cnblogs.com/zhouguomao/p/11450921.html

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 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 serve

1.在cmd界面搭建react-native 环境: 可参考https://reactnative.cn/docs/0.51/getting-started.html#content   (1)npm install -g yarn react-native-cli       安装yarn命令工具和react-native命令工具,Yarn是Facebook提供的替代npm的工具,可以加速n

http://www.bubuko.com/infodetail-2599307.html 1.在cmd界面搭建react-native 环境: 可参考https://reactnative.cn/docs/0.51/getting-started.html#content (1)npm install -g yarn react-native-cli 安装yarn命令工具和react-native命令工具,Yarn是Facebook提供的替代npm的工具,可以加速node模块的下载. Reac

This content should also be served over HTTPS

HTTPS 是 HTTP over Secure Socket Layer,以安全为目标的 HTTP 通道,所以在 HTTPS 承载的页面上不允许出现 http 请求,一旦出现就是提示或报错: Mixed Content: The page at 'https://domain.com/w/a?id=074ac65d-70db-422d-a6d6-a534b0f410a4' was loaded over HTTPS, but requested an insecure image 'http:

@RequestBody对象为空,异常Required request body is missing

1.异常 org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing 2.问题复现: @RequestMapping(value = "/somewhere", method = POST) public SomeResponse someHandler(@RequestBody XXXDTO xxxDTO) { ... } 当入参DTO对象为空

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main re

deb http://packages.linuxmint.com sonya main upstream import backport deb http://mirror.neu.edu.cn/ubuntu xenial main restricted universe multiversedeb http://mirror.neu.edu.cn/ubuntu xenial-updates main restricted universe multiversedeb http://mirro

异常:cvc-complex-type.2.4.a: Invalid content was found starting with element

web.xml 出现cvc-complex-type.2.4.a: Invalid content was found starting with element <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance  http://www.springmodules.

http升级https的时候,遇到一个问题

问题: Mixed Content: The page at 'https://api.xxxx.com/test' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.xxxx.com/test'. This request has been blocked; the content must be served over HTTPS. 添加这个: <meta http-equ

跨域请求所遇到的错误

1.Mixed Content: The page at 'https://www.1399p.com/api/kaijiang.html?lottery=pk10,cqssc,xyft&set=pk10&bgcolor=e0e0e0' was loaded over HTTPS, but requested an insecure script 'http://s23.cnzz.com/stat.php?id=5959517&web_id=5959517'. This reque