Hi i have deployed my application in filezilla and now i am getting Cross-Origin Request Blocked error
In my browser if i disable web security it is working, without this what is the solution for this error.
Hi i have deployed my application in filezilla and now i am getting Cross-Origin Request Blocked error
In my browser if i disable web security it is working, without this what is the solution for this error.
you can try this on server side in response object. and at the client side use mozilla firefox browser if your are not pushing pages through server.
function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type, Accept');
if ('OPTIONS' == req.method) {
res.send(200);
}
else {
next();
}
};
Thanks
Try this :
header("Access-Control-Allow-Origin", "*");
header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");