Try to search your question here, if you can't find : Ask Any Question Now ?

Custom TFS Extension preflight and cors error

HomeCategory: stackoverflowCustom TFS Extension preflight and cors error
Avatarjohn asked 4 months ago

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?

1 Answers
Best Answer
AvatarMatthias answered 4 months ago
Your Answer

11 + 5 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com