Web API Error - This request has been blocked the content must be served over HTTPS

0 votes

We have deployed the api on azure and are trying to consume in our web app written in angular 5. However when we try to consume the api we are getting following errors. Chrome Mixed Content: The page at 'https://somedevapp.azurewebsites.net/#/managesomething' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://admindevapp.azurewebsites.net/api/data/getdata'. This request has been blocked; the content must be served over HTTPS. Firefox Blocked loading mixed active content. Is this issue related to CORS? How to resolve this issue?

Any help on this is appreciated!

Feb 16, 2022 in Others by Rahul
• 9,670 points
33,803 views

1 answer to this question.

0 votes

 If your web app is being hosted over HTTPs as you've indicated, then all external resources it is consuming should also use SSL and be secured through HTTPs. Think about it. It would defeat the purpose of your app being secure, if your app was in turn making insecure requests to an API.

You can either therefore, change your API calls to use HTTPs or Use HTTP instead of HTTPs, along with adding the following meta tag to your <head> element in your HTML:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

answered Feb 16, 2022 by Aditya
• 7,680 points

Related Questions In Others

0 votes
1 answer

HTTP Error 403.14 - Forbidden - The Web server is configured to not list the contents of this directory

Try keeping this into your web config ...READ MORE

answered Feb 11, 2022 in Others by Rahul
• 9,670 points
11,469 views
0 votes
0 answers

The page cannot be displayed because an internal server error has occurred on server

When  I've deployed the website I installed  ...READ MORE

May 23, 2022 in Others by Kichu
• 19,050 points
878 views
0 votes
1 answer

powerbi embeded in .net core 1.1

See if it helps: https://www.nuget.org/packages/PowerBI.NetStandar ...READ MORE

answered Nov 28, 2018 in Power BI by Upasana
• 8,620 points
1,233 views
0 votes
1 answer

Power BI Embedded : Importing Packages

This should help you out. https://www.nuget.org/packages/PowerBI.N ...READ MORE

answered Apr 3, 2019 in Power BI by Shubham
• 13,490 points
477 views
0 votes
1 answer

Refused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'

 I managed to solve the issue by ...READ MORE

answered Feb 18, 2022 in Others by Aditya
• 7,680 points
21,277 views
0 votes
1 answer

TCPDF ERROR: Some data has already been output, can't send PDF file

To answer your question, do add the ...READ MORE

answered Feb 16, 2022 in Others by Aditya
• 7,680 points
3,595 views
0 votes
1 answer

Git error: "Please make sure you have the correct access rights and the repository exists"

Your git URL might have changed. Change ...READ MORE

answered Feb 17, 2022 in Others by Aditya
• 7,680 points
9,679 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP