From 78ce457946325cf59e84bd2115c2f94a8e3fc6ad Mon Sep 17 00:00:00 2001 From: Elinor Date: Thu, 2 Nov 2023 16:37:36 +0300 Subject: [PATCH] Fix: Resolve codeQL alerts (#2861) --- index.js | 12 ------------ server.js | 12 ------------ .../services/actions/query-action-creator-util.ts | 4 ++-- 3 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 index.js delete mode 100644 server.js diff --git a/index.js b/index.js deleted file mode 100644 index facf89cdf..000000000 --- a/index.js +++ /dev/null @@ -1,12 +0,0 @@ -const express = require('express'); -const path = require('path'); -const app = express(); - -app.use(express.static(path.join(__dirname, 'build'))); - -app.get('/', function (req, res) { - res.removeHeader('X-Frame-Options'); - res.sendFile(path.join(__dirname, 'build', 'index.html')); -}); - -app.listen(process.env.PORT || 9000); diff --git a/server.js b/server.js deleted file mode 100644 index facf89cdf..000000000 --- a/server.js +++ /dev/null @@ -1,12 +0,0 @@ -const express = require('express'); -const path = require('path'); -const app = express(); - -app.use(express.static(path.join(__dirname, 'build'))); - -app.get('/', function (req, res) { - res.removeHeader('X-Frame-Options'); - res.sendFile(path.join(__dirname, 'build', 'index.html')); -}); - -app.listen(process.env.PORT || 9000); diff --git a/src/app/services/actions/query-action-creator-util.ts b/src/app/services/actions/query-action-creator-util.ts index 1f39279e7..c0f038aa6 100644 --- a/src/app/services/actions/query-action-creator-util.ts +++ b/src/app/services/actions/query-action-creator-util.ts @@ -18,7 +18,7 @@ import { ClientError } from '../../utils/error-utils/ClientError'; import { encodeHashCharacters } from '../../utils/query-url-sanitization'; import { translateMessage } from '../../utils/translate-messages'; import { authProvider, GraphClient } from '../graph-client'; -import { DEFAULT_USER_SCOPES } from '../graph-constants'; +import { DEFAULT_USER_SCOPES, GRAPH_URL } from '../graph-constants'; import { QUERY_GRAPH_SUCCESS } from '../redux-constants'; import { queryRunningStatus } from './query-loading-action-creators'; @@ -55,7 +55,7 @@ export function createAnonymousRequest(query: IQuery, proxyUrl: string, queryRun }); } - const authToken = '{token:https://graph.microsoft.com/}'; + const authToken = `{token:${GRAPH_URL}/}`; let headers = { Authorization: `Bearer ${authToken}`, 'Content-Type': 'application/json',