From 0d621c045b98231ad61435a91517786e13ed52a8 Mon Sep 17 00:00:00 2001 From: Przemek Wiech Date: Tue, 12 Feb 2019 23:45:57 +0100 Subject: [PATCH] Added handleCors URL parameter to turn off using cors-anywhere --- src/chart_view.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chart_view.tsx b/src/chart_view.tsx index 5d2694b..ff4e2ee 100644 --- a/src/chart_view.tsx +++ b/src/chart_view.tsx @@ -179,6 +179,7 @@ export class ChartView extends React.Component { const parsedGen = Number(getParam('gen')); const generation = !isNaN(parsedGen) ? parsedGen : undefined; const hash = getParam('file'); + const handleCors = getParam('handleCors') !== 'false'; if (hash && hash !== this.state.hash) { // New "load from file" data. @@ -209,7 +210,7 @@ export class ChartView extends React.Component { this.loadFromUrl(url, { indi, generation, - handleCors: url.startsWith('http'), + handleCors: url.startsWith('http') && handleCors, }); } else if (!url && !gedcom && hash !== this.state.hash) { this.props.history.replace({pathname: '/'});