sbis3-bl-request
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -6,7 +6,9 @@ 'use strict'; | ||
var https = require('https'); | ||
var url = require('url'); | ||
function doRequest(connection, reqParams) { | ||
var isHTTPS = connection.hostname.indexOf('https') != -1; | ||
var urlInfo = url.parse(connection.hostname); | ||
var isHTTPS = urlInfo.protocol == 'https:'; | ||
var protocol = isHTTPS ? https : http; | ||
connection.hostname = connection.hostname.replace(/https:\/\//g, '').replace(/http:\/\//g, ''); | ||
connection.hostname = urlInfo.hostname; | ||
connection.port = isHTTPS ? 443 : 80; | ||
@@ -13,0 +15,0 @@ var deferred = q.defer(); |
{ | ||
"name": "sbis3-bl-request", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "q": "^1.1.2" |
4929
131