Linked Questions

Popular Questions

Angular 6 changes an https request to https

Asked by At

I have an Angular 6 project that uses Laravel as a restful api. I moved the project on to the server for testing and some of my requests are getting the are getting the following error.

Mixed Content: The page at 'https://example-angular-site.com/profile' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://example-laravel-end.com/api/image'. This request has been blocked; the content must be served over HTTPS.

However, the original request was made using 'https://example-laravel-end.com' but was changed to http. I checked my network tab on google chrome and it confirms that the 'Request URL" is https. I have tried the following to fix the problem and none of them work.

  1. I enabled cors on the laravel end
  2. I used the .htaccess to redirect all traffic to https

Can anyone help me fix this error? If it helps I am using Netlify for the Angular end and Heroku for Laravel.

Related Questions