Skip to content

Commit

Permalink
[core][client] mirror window.location.protocol format in config (apac…
Browse files Browse the repository at this point in the history
  • Loading branch information
williaster committed Sep 27, 2018
1 parent 8878bd4 commit 8c5aab4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/superset-ui-core/src/SupersetClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import callApi from './callApi';
class SupersetClient {
constructor(config) {
const {
protocol = 'http',
host = '',
protocol = 'http:',
host = 'localhost',
headers = {},
mode = 'same-origin',
timeout,
Expand All @@ -15,7 +15,7 @@ class SupersetClient {
this.host = host;
this.mode = mode;
this.timeout = timeout;
this.protocol = protocol;
this.protocol = `${protocol}${protocol.slice(-1) === ':' ? '' : ':'}`;
this.credentials = credentials;
this.csrfToken = null;
this.didAuthSuccessfully = false;
Expand Down Expand Up @@ -64,7 +64,7 @@ class SupersetClient {
getUrl({ host = '', endpoint = '' }) {
const cleanHost = host.slice(-1) === '/' ? host.slice(0, -1) : host; // no backslash

return `${this.protocol}://${cleanHost}/${endpoint[0] === '/' ? endpoint.slice(1) : endpoint}`;
return `${this.protocol}//${cleanHost}/${endpoint[0] === '/' ? endpoint.slice(1) : endpoint}`;
}

ensureAuth() {
Expand Down

0 comments on commit 8c5aab4

Please sign in to comment.