Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix: disable domain sharding on explore view (apache#10787)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace Guo authored and erik_ritter committed Sep 3, 2020
1 parent 486ac18 commit 402858e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions superset-frontend/src/chart/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { addDangerToast } from '../messageToasts/actions';
import { logEvent } from '../logger/actions';
import { Logger, LOG_ACTIONS_LOAD_CHART } from '../logger/LogUtils';
import getClientErrorObject from '../utils/getClientErrorObject';
import { allowCrossDomain as allowDomainSharding } from '../utils/hostNamesConfig';
import { allowCrossDomain as domainShardingEnabled } from '../utils/hostNamesConfig';

export const CHART_UPDATE_STARTED = 'CHART_UPDATE_STARTED';
export function chartUpdateStarted(queryController, latestQueryFormData, key) {
Expand Down Expand Up @@ -106,6 +106,9 @@ const legacyChartDataRequest = async (
requestParams = {},
) => {
const endpointType = getLegacyEndpointType({ resultFormat, resultType });
const allowDomainSharding =
// eslint-disable-next-line camelcase
domainShardingEnabled && requestParams?.dashboard_id;
const url = getExploreUrl({
formData,
endpointType,
Expand Down Expand Up @@ -153,6 +156,9 @@ const v1ChartDataRequest = async (
const qs = requestParams.dashboard_id
? { dashboard_id: requestParams.dashboard_id }
: {};
const allowDomainSharding =
// eslint-disable-next-line camelcase
domainShardingEnabled && requestParams?.dashboard_id;
const url = getChartDataUri({
path: '/api/v1/chart/data',
qs,
Expand Down Expand Up @@ -182,7 +188,7 @@ export async function getChartDataRequest({
...requestParams,
};

if (allowDomainSharding) {
if (domainShardingEnabled) {
querySettings = {
...querySettings,
mode: 'cors',
Expand Down

0 comments on commit 402858e

Please sign in to comment.