Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache-control is not allowed by Access-Control-Allow-Headers in preflight response #1408

Open
dalesupa22 opened this issue Apr 25, 2023 · 1 comment

Comments

@dalesupa22
Copy link

dalesupa22 commented Apr 25, 2023

Hi guys,

I am trying to validate a valid json Blockcerts credential V2 and Im getting the following error:

Access to XMLHttpRequest at 'https://api.etherscan.io/api?module=proxy&action=eth_getTransactionByHash&txhash=0x21a53b030da894ce42b1f18483bc59ef4c3e8f9d2b5b36b3769954487fe73b2b&apikey=XXXXXXXXXXXXXX' from origin 'https://www.blockcerts.org/' has been blocked by CORS policy: Request header field cache-control is not allowed by Access-Control-Allow-Headers in preflight response.

After a long time dealing with it... I found that the problem🐞🐞🐞 was the following code:

.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0")

Please remove this part from the code in order to make it work again.

@lemoustachiste
Copy link
Member

Hi @dalesupa22,

I think this issue has been resolved although I found out about it through another channel.

Do you mind checking again if it has been fixed for you?

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

No branches or pull requests

2 participants