Skip to content

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

@dalesupa22

Description

@dalesupa22

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions