Responsive Ad Area

Share This Post

test

Custom TFS Extension preflight and cors error

I want to develop custom extension in tfs2018 and I want to make a rest call in it.
I did cors configurations in tfs server (https://enable-cors.org/server_iis6.html)

Failed to load:”api url” Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘null’ is therefore not allowed access.

jqXHRFields: {
withCredentials: true }, crossDomain: true, …..

jqXHR.setRequestHeader(“Authorization”, “Basic ” + ***”));
jqXHR.setRequestHeader(“Content-Type”,”application/jsonp;charset=UTF-8″);

jqXHR.setRequestHeader(“Access-Control-Allow-Origin”, “*”);
jqXHR.setRequestHeader(“Access-Control-Allow-Headers”, “origin,
content-type, accept, accessToken”);

jqXHR.setRequestHeader(“Access-Control-Allow
Methods”,”POST,GET,PUT,PATCH,DELETE,OPTIONS”);
jqXHR.setRequestHeader(“Access-Control-Allow-Credentials”, “true”);
jqXHR.setRequestHeader(“Access-Control-Expose-Headers”,
“accessToken”);
jqXHR.setRequestHeader(“Access-Control-Max-Age”, “600”);

By the way same code work in internet explorer and failed in chrome?What should we add?


Custom TFS Extension preflight and cors error
Custom TFS Extension preflight and cors error
test
{$excerpt:n}

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Skip to toolbar