0
I developed a Node api using restify only for real-time warnings, but came across a https problem:
If the origin of the request comes from an https site the api does not work
My Cors on the Node is like this:
const cors = corsMiddleware({
preflightMaxAge: 5,
origins: ['*'],
allowHeaders: ['*'],
exposeHeaders: ['*']
})
I call it:
const cors = require('./cors')
app.pre(cors.preflight)
app.use(cors.actual)
When the originating site https://site.com tries to access my api, gives the following message:
Mixed Content: The page at 'https://site.com/client/compras' was Loaded over HTTPS, but requested an insecure Xmlhttprequest endpoint 'http://minhaapi.nodejs7602.servor.net:21289/socket.io/? EIO=3&transport=polling&t=Mlpytyv'. This request has been blocked; the content must be served over HTTPS.
This problem only occurs when the site is on https
How can I fix this?