mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Switch auto-faucet from XMLHttpRequest to fetch
This commit is contained in:
parent
235a70b939
commit
f80d1ce3e6
@ -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)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user