[Pkg-javascript-commits] [sockjs-client] 323/350: Fix #254 use https module for xhr requests within node if needed

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:04:35 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit 05c8404c626391ce054072991e8f702e9517c0d0
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Fri Jul 31 11:10:14 2015 -0700

    Fix #254 use https module for xhr requests within node if needed
---
 lib/transport/driver/xhr.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/transport/driver/xhr.js b/lib/transport/driver/xhr.js
index 440d3c7..ccf65fe 100644
--- a/lib/transport/driver/xhr.js
+++ b/lib/transport/driver/xhr.js
@@ -3,6 +3,7 @@
 var EventEmitter = require('events').EventEmitter
   , inherits = require('inherits')
   , http = require('http')
+  , https = require('https')
   , URL = require('url-parse')
   ;
 
@@ -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 = '';
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list