Skip to content

Commit

Permalink
Fix #254 use https module for xhr requests within node if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
brycekahle committed Jul 31, 2015
1 parent 8094bf0 commit 05c8404
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/transport/driver/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var EventEmitter = require('events').EventEmitter
, inherits = require('inherits')
, http = require('http')
, https = require('https')
, URL = require('url-parse')
;

Expand All @@ -26,7 +27,8 @@ function XhrDriver(method, url, payload, opts) {
, agent: false
};

this.req = http.request(options, function(res) {
var protocol = parsedUrl.protocol === 'https:' ? https : http;
this.req = protocol.request(options, function(res) {
res.setEncoding('utf8');
var responseText = '';

Expand Down

0 comments on commit 05c8404

Please sign in to comment.