From ca6c79b58fc7db0d037fc52c6f02ce752367174a Mon Sep 17 00:00:00 2001 From: Ilango Date: Tue, 8 Nov 2016 18:56:47 -0500 Subject: [PATCH 1/2] [OLINGO-1043] Support https protocol in olingo-odata4-js --- lib/odata/net.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/odata/net.js b/lib/odata/net.js index be45295..1eece27 100644 --- a/lib/odata/net.js +++ b/lib/odata/net.js @@ -21,6 +21,7 @@ var http = require('http'); +var https = require('https'); var utils = require('./../utils.js'); var url = require("url"); @@ -117,8 +118,7 @@ exports.defaultHttpClient = { } } - - var xhr = http.request(options); + var xhr = (options.protocol=="http:")? http.request(options) : https.request(options); result.abort = function () { if (done) { From f2e17cff79b3792770a78172a6676fca6f549bda Mon Sep 17 00:00:00 2001 From: Venkatesh Ilango Date: Mon, 16 Apr 2018 15:41:08 -0700 Subject: [PATCH 2/2] Determining the protocol http --- lib/odata/net.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/odata/net.js b/lib/odata/net.js index 1eece27..09205ab 100644 --- a/lib/odata/net.js +++ b/lib/odata/net.js @@ -117,8 +117,8 @@ exports.defaultHttpClient = { options.headers[name] = request.headers[name]; } } - - var xhr = (options.protocol=="http:")? http.request(options) : https.request(options); + + var xhr = options[protocol].request(options); result.abort = function () { if (done) { @@ -192,4 +192,4 @@ exports.defaultHttpClient = { exports.canUseJSONP = canUseJSONP; exports.isAbsoluteUrl = isAbsoluteUrl; -exports.isLocalUrl = isLocalUrl; \ No newline at end of file +exports.isLocalUrl = isLocalUrl;