This request has been blocked; the content must be served over HTTPS – What’s going on?
When you are deploying the API on Chrome and trying to consume it for the web app, have you ever got the error This request has been blocked; the content must be served over HTTPS? Actually, Chrome comes with a security feature, so it will block insecure content (HTTP) that has been loaded through a secure page (HTTPS). If you want to know how to address this issue, let’s follow some solutions we suggest to you below!
How to solve This request has been blocked; the content must be served over HTTPS
Since your web app is hosted over HTTPS, all the external resources it consumes including API calls, CDN, CSS files, and scripts have to utilize SSL and must be secured via HTTPS. Therefore, it’s a good idea for you to try some following methods.
- Changing the API calls to use HTTPS.
- Adding the meta tag code to the
<head>
element in the HTML file:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
Wind-up
All in all, we hope that you can effectively tackle the issue with the help of the blog today. If you have more solutions to deal with this error, don’t hesitate to let us know by leaving your comment below. What’s more? Don’t forget to share the blog with others if you think it is useful.
In addition, in case you are using WordPress or Joomla platform to build up and develop your site, don’t hesitate to have a look at our responsive and eye-catching Free WordPress Themes and Joomla 4 Templates here. We believe that getting one of them and using it for your site will give your site a professional and good-looking appearance. Thanks for your reading and hope you enjoy it! See you in the next post.
0 Commentaires