Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax post via https from an http page

I have an ajax call that really needs to be https. However, the page that it is being called from is http. The browser complains about restricted URI denied, presumably due to the same origin policy. Are there any known workaround for this?

like image 660
Jordin Po Avatar asked Jul 25 '26 00:07

Jordin Po


1 Answers

Yes, that's same-origin policy stopping you. You have to use same workarounds as for cross-domain requests.

Requests from non-secure website are not secure, even if you're making requests to HTTPS URLs (because MITM attack can replace all "https" with "http"), so you should consider using HTTPS for the whole page.

like image 91
Kornel Avatar answered Jul 27 '26 16:07

Kornel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!