[SteemPlus] CORS error when getting rates from bittrex

in #utopian-io5 years ago (edited)

Project Information

Expected Behavior

getPriceSteemAsync, getPriceSBDAsync and getBTCPriceAsync should return rates when the response is resolved.

Actual Behavior

Uncaught Error gets throws because response is not received from bittrex due to CORS Error

Steps to Reproduce

  1. Install SteepPlus Version 3.8.2.1 in Chrome.
  2. Enable the extension if its not already enabled.
  3. Go to busy.org and login.
  4. Open Dev toolbar to check Console for errors.

Explanation of Issue

When you try to access an API which has no CORS header, you get a success response 200 but no response data. This is because most browser have same origin policy in place to prevent a malicious api getting called using session information without website intending it to.

Fixing CORS Header

As such, you will not be able to get around this issue from extension directly without bittrex making a change in thr api to include CORS header. This is unlikely to happen so to get around this problem, you can create a node middleware API. This api when called, will make a call to bittrex and once the response it returned, it will pipe the response to extension with CORS header added.

Please note that you can't test CORS issues on localhost as they are ignored on localhost. They only surface once the code is deployed on server.

Screen Shot 2019-04-04 at 7 52 19 PM

Browser: Chrome Version 73.0 (Official Build) (64-bit)
Operating system: OSX 10.11.6
Version: 3.8.2.1

GitHub Account : https://github.com/mightypanda-x
GitHub Issue : https://github.com/stoodkev/SteemPlus/issues/192

Sort:  

Thanks for your contribution, I was able to replicate the issue and overall the outcome of this error is that the real time wallet value feature doesn't work. As seen here:

Although your contribution is detail in respect to the code, it would have also been nice to see this linked up to the end user experience, however from a developer point of view it's makes complete sense and think it holds value in the resolution of the issue :)

It seems that the developer of the project is becoming more active again, so hopefully we'll see some more updates and possibly a resolution to this in the near future :)

Once again, thanks for your contribution and look forward to more from you soon.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thanks for the review

Thank you for your review, @tobias-g! Keep up the good work!

Thank you for visiting my home, Faithful friend

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by mightyPanda from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Hi, @mightypanda!

You just got a 1.63% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hi @mightypanda!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @mightypanda!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 62676.37
ETH 2581.43
USDT 1.00
SBD 2.72