项目中用到iframe嵌入网页,因为是前后端分离的,所以前端会报错Refused to display ‘网址' in a frame because it set 'X-Frame-Options' to 'deny'.

原因是前后端分离,前后端不在同一个域中,这时我们就要把X-Frame-Options这个头部给除掉,网上搜了很多,都是讲怎么加这个的,但是除掉的没有很多资料,
开始加了个资源过滤器,还是不行,在startup中加了 options.SuppressXFrameOptionsHeader = true;也是不行,最后在官网找到了,在静态文件那里给文件除去了X-Frame-Options'这个头

参考文献:https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/static-files?view=aspnetcore-2.2

X-Frame-Options报错处理的更多相关文章

  1. iframe跨源报错:"Blocked a frame with origin from accessing a cross-origin frame"

    一.报错信息: “Blocked a frame with origin from accessing a cross-origin frame” 二.在stackoverflow上找到原因 Same ...

  2. easyui报错“Cannot read poperty 'options' of undefined”问题解决方案之一

    别逼逼了,我要看解决方法 问题产生原因 最近在项目中使用jquery easyui做页面.其中有个优化问题,我是将原本由jsp通过jstl标签生成的页面改成js通过dom去延迟生成了. 但是js生成的 ...

  3. iframe跨端口报错 Blocked a frame with origin from accessing a cross-origin frame

    前言    在不同的端口号,甚至是不同的ip进行iframe嵌套的时候,在父页面调用子页面的方法的时候,报错 SecurityError: Blocked a frame with origin fr ...

  4. 解决incorrect 'only available in ES6' warning (W119) with options `moz: true, esversion: 6` 报错问题

    很多同学在新建vue项目时,会遇到 incorrect 'only available in ES6' warning (W119) with options `moz: true, esversio ...

  5. Jenkins Html Rport 使用frame报错解决办法

    对于Blocked script execution in '<URL>' because the document's frame is sandboxed and the 'allow ...

  6. tornado接收ajax的post请求报错WARNING:tornado.access:405 OPTIONS /add

    后端报错信息 WARNING:tornado.access:405 OPTIONS /add (::1) 1.00m 前端报错信息 2xhr.js?ec6c:172 OPTIONS http://lo ...

  7. moviepy音视频剪辑:使用fl_time报错OSError: MoviePy error: failed to read the first frame of video file

    专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt+moviepy音视频剪辑实战 专栏:PyQt入门学习 老猿Python博文目录 老猿学5G博文目录 在m ...

  8. 报错 Invalid options in vue.config.js: "baseUrl" is not allowed 问题解决

    报错 Invalid options in vue.config.js: "baseUrl" is not allowed vue3.0版本中 执行 npm run build会出 ...

  9. 【.NET调用Python脚本】C#调用python requests类库报错 'module' object has no attribute '_getframe' - IronPython 2.7

    最近在开发微信公众号,有一个自定义消息回复的需求 比如用户:麻烦帮我查询一下北京的天气? 系统回复:北京天气,晴,-℃... 这时候需要根据关键字[北京][天气],分词匹配需要执行的操作,然后去调用天 ...

随机推荐

  1. redis string类型 增删改查

    string一.设置 1.设置一个键值对时,如果该键已存在,那么就成了updata (key:value) 例: set name jiang 访问值:get name 2.设置值过期时间:setex ...

  2. 【做题笔记】洛谷P1506 拯救oibh总部

    跑一遍染色法,最后判断哪些位置没被染色即可 一些技巧: 为了判断方便,把字符转换成 int 型的数字. 注意边界问题 详细解释见代码 #include <iostream> #includ ...

  3. HDU1312 Red and Black(dfs+连通性问题)

    这有一间铺满方形瓷砖的长方形客房. 每块瓷砖的颜色是红色或者黑色. 一个人站在一块黑色瓷砖上, 他可以从这块瓷砖移动到相邻(即,上下左右)的四块瓷砖中的一块. 但是他只能移动到黑色瓷砖上,而不能移动到 ...

  4. 题解【Vijos1159】岳麓山上打水

    题面 迭代加深搜索模板题. 注意开始时要先对桶的容量从小到大排序. 达到搜索层数时使用完全背包\(\text{check}\)即可. 具体实现参考代码. #include <bits/stdc+ ...

  5. Ubuntu 的apt install 和卸载正确姿势

    先说下使用apt  installl 安装的包的卸载: apt-get remove: 卸载软件apt-get purge: 卸载软件和配置文件apt-get autoremove: 移除没有使用的依 ...

  6. Ubuntu卸载软件Firefox

    查找火狐详细内容: dpkg --get-selections |grep firefox  删除 sudo apt-get purge firefox* 

  7. python logging模块日志回滚RotatingFileHandler

    # coding=utf-8 import logging import time import os import logging.handlers def logger(appname,roots ...

  8. spring(一):思维导图

  9. 12.动态内存和智能指针、 直接管理内存、shared_ptr和new结合使用

    12.动态内存和智能指针 1.智能指针分为两种shared_ptr和unique_ptr,后者独占所指向的对象.智能指针也是模板,使用时要用尖括号指明指向的类型.类似emplace成员,make_sh ...

  10. HTML学习(1)简介

    HTML---HyperText Markup Language,超文本标记语言,是一种用于创建网页的标准标记语言. 注意:对于中文网页需要使用 <meta charset="utf- ...