Wed, 03/02/2022 - 02:08
#1
Plantronics browser integration JS
Hi,
In an Angular9 project, i want to init the plantronics driver for browser. I can see the attached devices on a browser tab open "http://127.0.0.1:32017/Spokes/DeviceServices/Info" or "https://127.0.0.1:32018/Spokes/DeviceServices/Info". But i get CORS error while requesting in the project.
I request the device info as below:
let xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
xhr.setRequestHeader('Accept', '*/*');
xhr.setRequestHeader('Accept-Language', 'en-GB,en-US;q=0.9,en;q=0.8,tr;q=0.7,de;q=0.6');
xhr.send();
This is the error i receive on browser log:
Access to XMLHttpRequest at 'http://127.0.0.1:32017/Spokes/DeviceServices/Info' from origin 'http://localhost:8190' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Have you experience the CORS issue as well?
Thanks
Add new comment