修改這個檔:
/opt/lampp/etc/httpd.conf
在 <Directory "/opt/lampp/htdocs"> 區段加入:
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "x-requested-with"
Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
重起
sudo /opt/lampp/bin/apachectl -k graceful
關於cors
沒有留言:
張貼留言