We help IT Professionals succeed at work.

CORS error - Even CORS is allowed for the domain - status 200 in network tab


I am getting CORS error in my website. Even though I am getting status 200 in network tab as CORS was allowed for the domain.

jquery-2.1.4.min.js:4 Access to XMLHttpRequest at 'https://authuat.mysite.com/api/users' from origin 'http://etgsit.hrt.uyetr.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

In Nework tab, I am getting status 200 for the API https://authuat.mysite.com/api/users as CORS was allowed for domain

Code as below:
        url: 'https://authuat.mysite.com/api/users',
        type: 'GET',
        xhrFields: { withCredentials: true },
        accept: 'application/json',
        async: false
    }).done(function (data) {


        .fail(function (jqXHR, textStatus, error) {


Open in new window

Please advise on this.

Watch Question

David FavorFractional CTO
Distinguished Expert 2019

Tip: http://etgsit.hrt.uyetr.com fails to resolve in DNS, so you'll have to fix this first or use an /etc/hosts entry, which will likely fail in many subtle ways for an API system.



URL is resolving that is the reason it is giving 200 status in network tab.
It is working now. It was not working because of cookie policy.
 I have updated my config to access in https only and I was accessing site in http.

Its working now . Thanks
details above