Skip to content

Commit

Permalink
changes for incorporation of accessing BE config with basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
prabrisha-rudder committed Oct 9, 2019
1 parent 256f5a8 commit 917a28e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rudder-client-javascript/analytics/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class Analytics {
//this.init([], this.configArray); TODO: Remove
getJSONTrimmed(
this,
CONFIG_URL + "/source-config?write_key=" + writeKey,
CONFIG_URL, writeKey,
this.processResponse
);
}
Expand Down
2 changes: 1 addition & 1 deletion rudder-client-javascript/analytics/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ let RudderIntegrationPlatform = {

let BASE_URL = "http://18.222.145.124:5000/dump";
//"https://rudderlabs.com";
let CONFIG_URL = "https://api.rudderlabs.com";
let CONFIG_URL = "https://api.rudderlabs.com/sourceConfig";//"https://api.rudderlabs.com/workspaceConfig";

let FLUSH_QUEUE_SIZE = 30;

Expand Down
3 changes: 2 additions & 1 deletion rudder-client-javascript/analytics/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function getJSON(url, wrappers, isLoaded, callback) {
* @param {*} url
* @param {*} callback
*/
function getJSONTrimmed(context, url, callback) {
function getJSONTrimmed(context, url, writeKey, callback) {
//server-side integration, XHR is node module
let cb_ = callback.bind(context);

Expand All @@ -98,6 +98,7 @@ function getJSONTrimmed(context, url, callback) {
var xhr = new XMLHttpRequestNode.XMLHttpRequest();
}
xhr.open("GET", url, true);
xhr.setRequestHeader("Authorization", "Basic " + btoa(writeKey + ":"));
xhr.onload = function() {
let status = xhr.status;
if (status == 200) {
Expand Down

0 comments on commit 917a28e

Please sign in to comment.