pouchdb的SCP(安全性内容策略)问题

编程入门 行业动态 更新时间:2024-10-28 13:15:53
本文介绍了pouchdb的SCP(安全性内容策略)问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我在Android设备上运行 ionic 应用时,控制台中出现错误:

I see an error in the console when running my ionic app on my android device:

Refused to connect to 'blob:http%3A//192.168.0.12%3A8100/9d72a06a-c6fa-4397-976c-41ea23f90be0' because it violates the following Content Security Policy directive: "default-src *". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback. i @ pouchdb.min.js:9 (index):28 Uncaught SecurityError: Failed to execute 'open' on 'XMLHttpRequest': Refused to connect to 'blob:http%3A//192.168.0.12%3A8100/9d72a06a-c6fa-4397-976c-41ea23f90be0' because it violates the document's Content Security Policy. 192.168.0.12:8100/lib/pouchdb/dist/pouchdb.min.js Line: 9console.(anonymous function) @ (index):28

它似乎与Content-Security-Policy有关,请您帮我调整一下,使其工作正常吗?

It seems to be related to te Content-Security-Policy, can you help me tune it so it works fine please ?

谢谢。 我当前的政策:

Thanks. My current policy:

index.html:

index.html:

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline' fonts.googleapis; script-src 'self' 'unsafe-inline' 'unsafe-eval' *">

推荐答案

对于正在寻找此错误解决方案的每个人, @baver的评论对我有用。

For everyone who's looking for a solution to this error, @beaver's comment worked for me.

我添加了以下内容:

connect-src * blob:;

我还添加了 * 允许其他连接

I've also added a * to allow other connections

更多推荐

pouchdb的SCP(安全性内容策略)问题

本文发布于:2023-10-30 02:56:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1541556.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:安全性   策略   内容   pouchdb   SCP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!