diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-04-05 00:39:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 00:39:56 +0800 |
commit | 953a29b19e30189954eb33f515004769081e856c (patch) | |
tree | 475dcf4fc8b3c7c0663951c4320f3e595b7e91ee /app | |
parent | 235a70b9392d8b87eae4fc141e7f0be1d7788ee2 (diff) | |
parent | f80d1ce3e61fec8948d418a470c00226773b3b38 (diff) | |
download | tangerine-wallet-browser-953a29b19e30189954eb33f515004769081e856c.tar tangerine-wallet-browser-953a29b19e30189954eb33f515004769081e856c.tar.gz tangerine-wallet-browser-953a29b19e30189954eb33f515004769081e856c.tar.bz2 tangerine-wallet-browser-953a29b19e30189954eb33f515004769081e856c.tar.lz tangerine-wallet-browser-953a29b19e30189954eb33f515004769081e856c.tar.xz tangerine-wallet-browser-953a29b19e30189954eb33f515004769081e856c.tar.zst tangerine-wallet-browser-953a29b19e30189954eb33f515004769081e856c.zip |
Merge pull request #1306 from MetaMask/redoAutoFaucetAsFetch
Switch auto-faucet from XMLHttpRequest to fetch
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/lib/auto-faucet.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/app/scripts/lib/auto-faucet.js b/app/scripts/lib/auto-faucet.js index 1e86f735e..73b73dfe6 100644 --- a/app/scripts/lib/auto-faucet.js +++ b/app/scripts/lib/auto-faucet.js @@ -4,9 +4,15 @@ const env = process.env.METAMASK_ENV module.exports = function (address) { if (METAMASK_DEBUG || env === 'test') return // Don't faucet in development or test - var http = new XMLHttpRequest() - var data = address - http.open('POST', uri, true) - http.setRequestHeader('Content-type', 'application/rawdata') - http.send(data) + let data = address + let headers = new Headers() + headers.append('Content-type', 'application/rawdata') + fetch(uri, { + method: 'POST', + headers, + body: data, + }) + .catch((err) => { + console.error(err) + }) } |