I'm writing a web app and I guess I have no idea how CORS works.
I have full control over the sending and receiving side.
I'm in Chrome, and the browser is reporting that the current page (http://site1.com/top.php
) has the response header of Access-Control-Allow-Origin: *
. And the AJAX call (to http://site2.com/project.php
) says that project.php is responding with the header Access-Control-Allow-Origin: *
.
I'm not sure if it's redundant if both top.php and project.php have this header. But I added it to both just to be sure.
Atlas, even with permissive Access Control, I get the error:
Access to XMLHttpRequest at '[http://site2.com/project.php]' from origin '[http://site1/top.php]' has been blocked by CORS policy: Request header field x-requested-with is not allowed by Access-Control-Allow-Headers in preflight response.