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

Cross site scripting error when browserified #11

Open
hawkmauk opened this issue Nov 14, 2019 · 0 comments
Open

Cross site scripting error when browserified #11

hawkmauk opened this issue Nov 14, 2019 · 0 comments

Comments

@hawkmauk
Copy link

hawkmauk commented Nov 14, 2019

When the browserified version is compiled (for use in the playground) I get the following error when clicking the Convert from TXREF button:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.blockcypher.com/v1/btc/test3/blocks/1201739?txstart=2&limit=1. (Reason: CORS request did not succeed).

I can get around this by adding 'user-agent' to the unsafeHeaders array:

var unsafeHeaders = [    'user-agent'

Having a look through the source I don't see this variable being defined so believe it is in one of the imported modules:

grep ./external/ -R -e 'var unsafeHeaders'                                                                                                         
./external/btcr-did-tools-js/btcrDidUtils.js:var unsafeHeaders = [                                                                                                                                            
./external/btcr-did-tools-js/node_modules/es6-promise/dist/test/browserify.js:    var unsafeHeaders = {                                                                                                       
./external/btcr-did-tools-js/node_modules/stream-http/lib/request.js:var unsafeHeaders = [                                                                                                                    
./external/btcr-did-tools-js/node_modules/txref-conversion-js/txrefConverter-browserified.js:var unsafeHeaders = [                                                                                            
./external/txref-conversion-js/txrefConverter-browserified.js:var unsafeHeaders = [
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

1 participant