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

web3 preflight options request blocked by Cloudflare #1

Open
imaibou opened this issue Dec 5, 2017 · 6 comments
Open

web3 preflight options request blocked by Cloudflare #1

imaibou opened this issue Dec 5, 2017 · 6 comments

Comments

@imaibou
Copy link

imaibou commented Dec 5, 2017

When trying to use the API in browser via web3.js, no call is being processed by myetherwallet.
After investigation, it turn out that the OPTIONS request made by the browser to check CORS support is not getting passed to the MyEtherWallet API endpoint, and is instead blocked by the Cloudflare server. Following is the OPTIONS request and the corresponding CloudFlare response:

Request:

OPTIONS /eth HTTP/1.1
Host: api.myetherapi.com
Connection: close
Access-Control-Request-Method: POST
Origin: null
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2837.0 Safari/537.36
Access-Control-Request-Headers: content-type
Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4

Response:

HTTP/1.1 403 Forbidden
Server: CloudFront
Date: Tue, 05 Dec 2017 10:03:40 GMT
Content-Type: text/html
Content-Length: 555
Connection: close
X-Cache: Error from cloudfront
Via: 1.1 d7d3ef7b74c87e295676d270227068b9.cloudfront.net (CloudFront)
X-Amz-Cf-Id: DDvrcDeSkZnlXMvMnrbqXQmdh51Z5oKIsTFm0sWR9Ri8DlZ1YoeG3g==

<TITLE>ERROR: The request could not be satisfied</TITLE> <\h1>ERROR<\/h1> <\h2>The request could not be satisfied.<\/h2>
Request blocked.

Generated by cloudfront (CloudFront)
Request ID: DDvrcDeSkZnlXMvMnrbqXQmdh51Z5oKIsTFm0sWR9Ri8DlZ1YoeG3g==
@freeatnet
Copy link

freeatnet commented Jan 7, 2018

It appears that myetherwalletapi config blocks certain regions / IP ranges from accessing it.

@tayvano
Copy link
Contributor

tayvano commented Jan 8, 2018

If you hit over 200 requests / minute, you'll be blocked for ~1hr, regardless of region.

@freeatnet
Copy link

@tayvano Fairly sure I did not issue over 200 rpm at any point. Can you confirm? https://gist.github.com/freeatnet/a1f8c085617a2d30862e5c97cefc80b2

@freeatnet
Copy link

@tayvano And again today. Please check into it.

@Fi1osof
Copy link

Fi1osof commented Feb 4, 2018

Was blocked just after 5 minutes...

ERROR
The request could not be satisfied.
Request blocked.
Generated by cloudfront (CloudFront)
Request ID: z58hYuLjQNPnO-j1pp6sR-ud8_zL8NZeVrVTVp9KKcocgZjjS154Tw==

Where i can read limits?

@Tenareth
Copy link

For what it is worth I just had this happen to me, the source for me appears to be the example index.html that comes with myetherapi, it "monitors" all transactions and seems to refresh pretty quickly. Might want to add some type of warning that the example can get you blocked from the main api within a few minutes.

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

5 participants