javascript - CORS - cross domain POST to HTTP from HTTPS -
i trying use xmlhttprequest post page loaded https different domain using http url. http server local (in home) server , cannot https. (this prototype/demo - home http server in set top box). server returns:
'access-control-allow-origin': '*', 'access-control-allow-methods' : 'get, post, put, delete, options' when post, appears browser has cancelled request. see warning in console:
the page @ 'https://xxx.html' loaded on https, displayed insecure content 'http://localhost:10293/yyy': content should loaded on https.
is there way make work?
the interesting thing can send delete http server, , works, not post! (the server handles 'option' request, , returns above 'access' headers. delete causes warning spit out, request sent, unlike post, request cancelled browser.
the server basic node.js server.
i able make work handling options request in http server:
response.writehead(200, { 'content-type': 'text/html', 'access-control-allow-origin': '*', 'access-control-allow-methods' : 'get, post, put, delete, options' }); response.end(); the issue post failing red herring - forget exact circumstances now, comment above says settimeout following post. not sure, working.
Comments
Post a Comment