Skip to content

Commit

Permalink
fix: Incorrect URL generation in HttpTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Oct 15, 2019
1 parent 74a8875 commit 7e7020b
Show file tree
Hide file tree
Showing 5 changed files with 2,855 additions and 880 deletions.
4 changes: 3 additions & 1 deletion packages/cubejs-client-core/dist/cubejs-client-core.esm.js
Expand Up @@ -28,6 +28,8 @@ import momentRange from 'moment-range';
import 'core-js/modules/es6.array.is-array';
import 'core-js/modules/es6.regexp.split';
import 'core-js/modules/es6.function.name';
import 'core-js/modules/es6.regexp.to-string';
import 'core-js/modules/es6.date.to-string';
import fetch from 'cross-fetch';
import 'url-search-params-polyfill';

Expand Down Expand Up @@ -758,7 +760,7 @@ function () {
}, {}));

var runRequest = function runRequest() {
return fetch("".concat(_this.apiUrl).concat(method, "?").concat(searchParams), {
return fetch("".concat(_this.apiUrl, "/").concat(method).concat(searchParams.toString().length ? "?".concat(searchParams) : ''), {
headers: {
Authorization: _this.authorization,
'Content-Type': 'application/json'
Expand Down
4 changes: 3 additions & 1 deletion packages/cubejs-client-core/dist/cubejs-client-core.js
Expand Up @@ -34,6 +34,8 @@ var momentRange = _interopDefault(require('moment-range'));
require('core-js/modules/es6.array.is-array');
require('core-js/modules/es6.regexp.split');
require('core-js/modules/es6.function.name');
require('core-js/modules/es6.regexp.to-string');
require('core-js/modules/es6.date.to-string');
var fetch = _interopDefault(require('cross-fetch'));
require('url-search-params-polyfill');

Expand Down Expand Up @@ -764,7 +766,7 @@ function () {
}, {}));

var runRequest = function runRequest() {
return fetch("".concat(_this.apiUrl).concat(method, "?").concat(searchParams), {
return fetch("".concat(_this.apiUrl, "/").concat(method).concat(searchParams.toString().length ? "?".concat(searchParams) : ''), {
headers: {
Authorization: _this.authorization,
'Content-Type': 'application/json'
Expand Down
2 changes: 1 addition & 1 deletion packages/cubejs-client-core/dist/cubejs-client-core.umd.js
Expand Up @@ -15086,7 +15086,7 @@
}, {}));

var runRequest = function runRequest() {
return browserPonyfill("".concat(_this.apiUrl).concat(method, "?").concat(searchParams), {
return browserPonyfill("".concat(_this.apiUrl, "/").concat(method).concat(searchParams.toString().length ? "?".concat(searchParams) : ''), {
headers: {
Authorization: _this.authorization,
'Content-Type': 'application/json'
Expand Down
2 changes: 1 addition & 1 deletion packages/cubejs-client-core/src/HttpTransport.js
Expand Up @@ -15,7 +15,7 @@ class HttpTransport {
);

const runRequest = () => fetch(
`${this.apiUrl}${method}?${searchParams}`, {
`${this.apiUrl}/${method}${searchParams.toString().length ? `?${searchParams}` : ''}`, {
headers: { Authorization: this.authorization, 'Content-Type': 'application/json' }
}
);
Expand Down

0 comments on commit 7e7020b

Please sign in to comment.