lundi 23 décembre 2019

Why is EmberJS adapter requesting content over HTTP When I've specified HTTPS?

In my set up currently, I have a certain model retrieving data from an azure serverless function. This function is served at

https://my-microservice.azurewebsites.net/api

For the adapter I have

...

export default DS.RESTAdapter.extend({
  ...

  host: config.serviceUrl,
  coalesceFindRequests: true,

  ...

});

and for the environment.js file, I have this line:

...

ENV.serviceUrl = 'https://my-microservice.azurewebsites.net/api';

...

Now, the odd part is that I have specifically set the URL for this service to be "https://" , but only some of my users are claiming that they get this error:

Mixed Content: The page at 'https://mywebsite.io' (index):1#/my-route/d1 was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://my-microservice.azurewebsites.net/api/<modelName>'. This request has been blocked; the content must be served over HTTPS.

What I don't understand is why this is happening in the first place - why am I getting a mixed content error when I am specifically asking Ember to use an https:// url for this adapter?

Additional info: 1. the data is being loaded via Ember-data, via an Ember model. The Ember model is told to use the given custom adapter. 2. Only some of my users are reporting this. When I try it myself, there are no such issues, which leads me to believe that there is some




Aucun commentaire:

Enregistrer un commentaire