bitpay / bitcore

A full stack for bitcoin and blockchain-based applications
https://bitcore.io/
MIT License
4.83k stars 2.08k forks source link

CORS error in api #2284

Open MonarthS opened 5 years ago

MonarthS commented 5 years ago

I'm using bitcore-wallet-client node module, which uses api https://bws.bitpay.com/bws/api.

It was working properly yesterday, but today I'm getting error that it is blocked by CORS policy.

Screen Shot 2019-07-23 at 3 59 36 PM

justinkook commented 5 years ago

I'm assuming you are using BWC locally on Copay (which runs on http://localhost:8100).

There is a Content-Security-Policy tag in app-template/index-template that you can comment out to disable CORS for localhost testing. CORS blocks localhost which includes http://localhost:8100 but not the iOS and Android build of Copay.

https://github.com/bitpay/copay/blob/f3d3bc998c05f32932f5fd3385348ccbf071aa50/app-template/index-template.html#L10