Merge pull request #59 from cubedro/master

Added check.status in httpsync.js
This commit is contained in:
Marek Kotewicz 2015-02-13 23:07:38 +01:00
commit 001077e0b9
4 changed files with 13 additions and 9 deletions

8
dist/ethereum.js vendored
View File

@ -1046,13 +1046,15 @@ var HttpSyncProvider = function (host) {
HttpSyncProvider.prototype.send = function (payload) {
//var data = formatJsonRpcObject(payload);
var request = new XMLHttpRequest();
request.open('POST', this.host, false);
request.send(JSON.stringify(payload));
// check request.status
var result = request.responseText;
// check request.status
if(request.status !== 200)
return;
return JSON.parse(result);
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -32,13 +32,15 @@ var HttpSyncProvider = function (host) {
HttpSyncProvider.prototype.send = function (payload) {
//var data = formatJsonRpcObject(payload);
var request = new XMLHttpRequest();
request.open('POST', this.host, false);
request.send(JSON.stringify(payload));
// check request.status
var result = request.responseText;
// check request.status
if(request.status !== 200)
return;
return JSON.parse(result);
};