Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

The 'Access-Control-Allow-Origin' header contains multiple values

(0) ShareShare
ReportReport
Posted on by 280
Hello everyone
 
I am working on a Dynamics 365 CRM on premise system, version 9.1 with the latest updates (December 2023).
I have a custom website that makes AJAX call to the dynamics 365 system using its Odata web API to retrieve some data. This call fails in the browser. I have pasted the error message below. The error message says, as you can read that the 'Access-Control-Allow-Origin' header contains multiple values. And it is also true, I can see in the browser DevTools that the 'Access-Control-Allow-Origin' header is present in the response headers form my dynamics 365 system two times - first one with the value * (wild card) and the second is the one I have added for my custom website.
 
I have added the http response header for my custom website in IIS website of the dynamics 365. I do not know where the first one comes from - the one with the wild card. I haven't added that one. Can anyone help?
 
The error message I see in the browser dev tools is:
 
/Access to XMLHttpRequest at 'https://dynamics-server/ORG/api/data/v9.1/records?$filter=name%20eq%20%27%20someSearchTerm%20term%20A/S%27' from origin 'http://my-custom-site.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, http://my-custom-site.com', but only one is allowed./ 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans