简体   繁体   English

HttpRequest 阻止混合内容

[英]HttpRequest blocked mixed content

 BASE_URL = "http://********:8091/api/v1";

I have uploaded my react-js application on.netlify.com.我已将我的 react-js 应用程序上传到 .netlify.com。 in react js I implemented APIs.... when I hit APIs after deploying I got this error on console:在 React js 中,我实现了 API……当我在部署后点击 API 时,我在控制台上收到了这个错误:

Mixed Content: The page at 'https://xyz.netlify.app/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http:// * **:8091/api/v1/categories/'.混合内容:“https://xyz.netlify.app/”页面已通过 HTTPS 加载,但请求了不安全的 XMLHttpRequest 端点“http:// * **:8091/api/v1/categories/”。 This request has been blocked;此请求已被阻止; the content must be served over HTTPS.内容必须通过 HTTPS 提供。

what is the solution to this解决这个问题的方法是什么

Unfortunately, There's no way to disable mixed content不幸的是,没有办法禁用混合内容

Just Add the Below meta tag to your HTML file只需将以下元标记添加到您的 HTML 文件中

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM