|
|
@ -4,9 +4,15 @@ const env = process.env.METAMASK_ENV |
|
|
|
|
|
|
|
|
|
|
|
module.exports = function (address) { |
|
|
|
module.exports = function (address) { |
|
|
|
if (METAMASK_DEBUG || env === 'test') return // Don't faucet in development or test
|
|
|
|
if (METAMASK_DEBUG || env === 'test') return // Don't faucet in development or test
|
|
|
|
var http = new XMLHttpRequest() |
|
|
|
let data = address |
|
|
|
var data = address |
|
|
|
let headers = new Headers() |
|
|
|
http.open('POST', uri, true) |
|
|
|
headers.append('Content-type', 'application/rawdata') |
|
|
|
http.setRequestHeader('Content-type', 'application/rawdata') |
|
|
|
fetch(uri, { |
|
|
|
http.send(data) |
|
|
|
method: 'POST', |
|
|
|
|
|
|
|
headers, |
|
|
|
|
|
|
|
body: data, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
|
|
console.error(err) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|