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 in Others by Rahul
• 8,980 points
4,744 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 by Aditya
• 7,280 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 in Others by Rahul
• 8,980 points
1,839 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 in Others by Kichu
• 19,040 points
79 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
595 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
179 views
0 votes
1 answer
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 in Others by Aditya
• 7,280 points
19 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP