Помогло добавление в .htaccess таких строк
Header add Access-Control-Allow-Origin "https://test.com"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"