public-api icon indicating copy to clipboard operation
public-api copied to clipboard

Requests suddenly failing because of CORS header

Open kaning opened this issue 8 years ago • 0 comments

Request header field X-USER-TOKEN is not allowed by Access-Control-Allow-Headers in preflight response. This happens when interacting with the API using javascript like so

const headers = {
        'Content-Type': 'application/json;charset=UTF-8',
	'X-USER-TOKEN': USER_TOKEN
};

return fetch(
   'https://api.logz.io/v1/search',
   'post',
   headers,
   body
 );

It was working about a couple of days ago.

kaning avatar Nov 17 '17 14:11 kaning