Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Apply code indentation #2010

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/web3-providers-http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ var https = require('https');
var HttpProvider = function HttpProvider(host, options) {
options = options || {};
this.host = host || 'http://localhost:8545';
if (this.host.substring(0,5) === "https"){
if (this.host.substring(0, 5) === "https") {
this.httpsAgent = new https.Agent({ keepAlive: true });
}else{
} else {
this.httpAgent = new http.Agent({ keepAlive: true });
}
this.timeout = options.timeout || 0;
this.headers = options.headers;
this.connected = false;
};

HttpProvider.prototype._prepareRequest = function(){
HttpProvider.prototype._prepareRequest = function() {
var request = new XHR2();
request.nodejsSet({
httpsAgent:this.httpsAgent,
httpAgent:this.httpAgent
httpsAgent: this.httpsAgent,
httpAgent: this.httpAgent
});

request.open('POST', this.host, true);
Expand All @@ -72,7 +72,7 @@ HttpProvider.prototype._prepareRequest = function(){
* @param {Object} payload
* @param {Function} callback triggered on end with (err, result)
*/
HttpProvider.prototype.send = function (payload, callback) {
HttpProvider.prototype.send = function(payload, callback) {
var _this = this;
var request = this._prepareRequest();

Expand Down Expand Up @@ -105,7 +105,7 @@ HttpProvider.prototype.send = function (payload, callback) {
}
};

HttpProvider.prototype.disconnect = function () {
HttpProvider.prototype.disconnect = function() {
//NO OP
};

Expand Down