Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

CORS issue : OPTIONS call is returning 405 #19

Open
mhmahmoodalam opened this issue Dec 22, 2018 · 0 comments
Open

CORS issue : OPTIONS call is returning 405 #19

mhmahmoodalam opened this issue Dec 22, 2018 · 0 comments

Comments

@mhmahmoodalam
Copy link

During preflight request OPTIONS call is returning 405
launchdarklycorserror
.
You could try to add below code to any React Component to reproduce it. The URL should be require authorization and call should be made from outside launch-darkly domain( for preflight validation to work).

The document says i need to add below two for authenticated CORS:

  • AuthoricationKey
  • withCredentials : true

componentDidMount() {
const response = fetch('https://URL', {
method: 'GET',
headers: new Headers({
Authorization: API_KEY,
'Content-type': 'application/json'
}),
credentials: 'include'
});
if (response.ok)
console.log( response.json());
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant