首页 > 其他分享 >[HTML5] Content Security Policy CSP Header

[HTML5] Content Security Policy CSP Header

时间:2023-06-22 14:22:08浏览次数:49  
标签:src none self fonts doesn Content Header HTML5 com

default-src "none"; script-src "self"; img-src "self" example.com; style-src fonts.googleapis.com; font-src fonts.gstatic.com;

<script src="/js/app.js"></script>: allow because script-src "self";

fetch("https://api.website.com/data"): doesn't allowbecause default-src "none", connect-src "none";

@font-face {url("fonts/my-font.woff")}: doesn't allowbecause font-src fonts.gstatic.com;doesn't allow self

<img src="data:image/svg+xml;..." />: doesn't allow because img-src "self" example.com , in order to allow, you need to do img-src 'self' example.com data:; 

<style>body {font-family: 'Roboto'}</style>: doesn't allowbecause style-src fonts.googleapis.com, no self;

<iframe src="https://embed.example.com"></iframe>: doesn't allow because default-src "none"; frame-src "none"

<link rel="stylesheet" href="https://fonts.googleapis.com..>: allowbecause style-src fonts.googleapis.com;

<video src=https://videos.example.com/..."></video>: doesn't allowbecause default-src "none"; media-src "none";

标签:src,none,self,fonts,doesn,Content,Header,HTML5,com
From: https://www.cnblogs.com/Answer1215/p/17496287.html

相关文章

  • 有了它,再也不用写setContentView了!好用,真的好用~
    前言大家多多少少都用过或者看过注解(Annotation),比如最常见@Override、@Deprecated等。近年来一些比较流行的三方框架都使用的注解,像ButterKnife(渐渐被Databinding、ViewBinding取代,已经停止维护)、Dagger、Room等等。那为什么这些大牛都这么热衷于使用注解呢?原因肯定是注解的好处多......
  • HTML5之FileReader的使用
    HTML5定义了FileReader作为文件API的重要成员用于读取文件,根据W3C的定义,FileReader接口提供了读取文件的方法和包含读取结果的事件模型。FileReader的使用方式非常简单,可以按照如下步骤创建FileReader对象并调用其方法:1.检测浏览器对FileReader的支持if(win......
  • nginx:报错upstream sent too big header(nginx 1.24)
    一,报错信息:访问网站时报错:如图: 查看nginx的错误日志:2023/06/1610:21:46[error]416087#0:*71148upstreamsenttoobigheaderwhilereadingresponseheaderfromupstream,client:223.72.69.14,server:blog.liuhongdi.com,request:"GET/index......
  • header("Content-type:text/html;charset=utf-8")
    它的意思是设置页面内容是html,编码格式是utf-8。header()函数的作用是:发送一个原始HTTP标头[HttpHeader]到客户端。标头(header)是服务器以HTTP协义传HTML资料到浏览器前所送出的字串,在标头与HTML文件之间尚需空一行分隔。在PHP中送回HTML资料前,需先传完所有的标......
  • 什么是 SAP Commerce Cloud 的 Content Catalog 概念
    SAPCommerceCloud的ContentCatalog是一个核心概念,用于管理和组织网站内容。ContentCatalog是一个包含页面、组件和其他相关资源的容器,它允许您以结构化和可重用的方式创建和管理网站的不同部分。在本文中,我们将详细介绍ContentCatalog的概念、用途和示例。ContentCatalog的......
  • 什么是 SAP Commerce Cloud 的 Content Slot
    内容槽(Contentslots)是组件的容器。要使组件在前端页面上显示,必须将其添加到内容槽中。内容槽分为三种类型:页面内容槽(Pagecontentslots):页面内容槽,也简称为槽,属于所在页面,即属于该页面实例。当向槽添加内容时,内容将显示在包含该槽的页面上。共享内容槽(Sharedcontentslots):共......
  • setContentView(R.layout.activity_);ui->setupUi(this);
    publicclassTutorialPartIIIextendsActivity{@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);//setContentView(R.layout.activity_tutorial_part_iii);//*......
  • axios headers设置发送接收文件类型
    接受blobexportfunctionexportTeacherActivitiesState(data:any):Promise<IResponse<Blob>>{ returnrequest({  baseURL,  url:"/Api/CourseEvaluationManage/ActivityStatistics/ExportTeacherActivitiesState",  method:"post......
  • 关于display:flex;justify-content: space-between;的最后一个元素无法左对齐的问题解
    1.问题:当使用v-for遍历一个数组,当数字长度不是要进行左右对齐的数字的倍数*(以3为例),无法进行左对齐的问题 解决方法:1.使用watch监听这个数组的长度的变化,判断这个数组的长度是否3%2是不是等于0,如果是为则这个数字追加一个空对象,代码如下:watch:{rowsForm:{......
  • 基于HTML5的chrome,firefox预览本地图片(扩展IE兼容)
    http://www.zhangxinxu.com/wordpress/?p=1923第一篇<scripttype="text/javascript"language="JavaScript"src="http://qingfengxia2.blog.163.com/blog/jquery.js"></script><scripttype="text/javascript"......