This is a segment of my ajax request
$.ajax({
url: url,
type:"POST",
crossDomain:true,
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
The url points to a controller, everything is on the same domain. I am using codeigniter, I have these headers set in both my controller and htaccess
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: X-Requested-With, content-type, X-Token, x-token');
I have read all the solutions on these links Making get request for same domain giving CORS error CORS error on same domain? and others but still not working. Please any suggestion?
This is the error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at "the link". (Reason: missing token ‘access-control-allow-headers’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel).