Skip to content

Commit 38fea64

Browse files
author
Chris Park
committed
Fixed improper parsing of URL for persistent connection protocol
1 parent efb0299 commit 38fea64

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
var http = require("http");
1717
var https = require("https");
18+
var URL = require("url");
1819

1920
var rosetteConstants = require("./rosetteConstants");
2021
var RosetteException = require("./rosetteExceptions");
@@ -78,7 +79,8 @@ function Api(userKey, serviceURL) {
7879
} else {
7980
this.serviceURL = "https://api.rosette.com/rest/v1/";
8081
}
81-
if (serviceURL.protocol === "http:") {
82+
var urlParts = URL.parse(serviceURL);
83+
if (urlParts.protocol === "http:") {
8284
this.protocol = http;
8385
}
8486

lib/rosetteRequest.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ rosetteRequest.prototype.bindingVersion = function() { return BINDING_VERSION; }
4949
* @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
5050
*/
5151
rosetteRequest.prototype.makeRequest = function(requestType, userKey, protocol, urlParts, parameters, callback) {
52-
protocol = https;
53-
5452
var maxRetries = 5;
5553
var interval = 500;
5654

0 commit comments

Comments
 (0)