From 8dad2da178ad5c5eabd728e67fa77946d7b8b96a Mon Sep 17 00:00:00 2001 From: Aleksandra Sikora Date: Thu, 21 Jan 2021 11:20:56 +0100 Subject: [PATCH] Revert "console: tag console requests" Reverts hasura/graphql-engine-mono#143 GitOrigin-RevId: fa16726ec4ea6f69153b0105c08de017874d158a --- CHANGELOG.md | 1 - console/src/utils/client.ts | 25 ------------------------- console/src/utils/requestAction.ts | 7 ------- 3 files changed, 33 deletions(-) delete mode 100644 console/src/utils/client.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 543bcc4a3f9..28c8fffe344 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -107,7 +107,6 @@ and be accessible according to the permissions that were configured for the role - console: misc bug fixes (close #4785, #6330, #6288) - console: allow setting table custom name (#212) - console: support tracking VOLATILE functions as mutations or queries (close #6228) -- console: add a special header to console requests for better logging (#143) - cli: add missing global flags for seed command (#5565) - cli: allow seeds as alias for seed command (#5693) - cli: fix action timeouts not being picked up in metadata operations (#6220) diff --git a/console/src/utils/client.ts b/console/src/utils/client.ts deleted file mode 100644 index 2206bf26a6f..00000000000 --- a/console/src/utils/client.ts +++ /dev/null @@ -1,25 +0,0 @@ -import globals from '../Globals'; -import { SERVER_CONSOLE_MODE } from '../constants'; - -export const getClientTypeHeader = () => { - let currentServerType = 'oss'; - if (globals.serverVersion.includes('pro')) { - currentServerType = 'pro'; - } else if (globals.serverVersion.includes('cloud')) { - currentServerType = 'cloud'; - } - - if (globals.consoleMode === SERVER_CONSOLE_MODE) { - return `hasura-console-server-${currentServerType}`; - } - - // it's on the CLI - if (currentServerType === 'oss') { - return 'hasura-console-cli-oss'; - } - - // there's only the pro-cli - return 'hasura-console-cli-pro'; -}; - -export const requestTagHeader = 'Hasura-Internal-Request-Source'; diff --git a/console/src/utils/requestAction.ts b/console/src/utils/requestAction.ts index 6371a8b3ad1..e42b027085a 100644 --- a/console/src/utils/requestAction.ts +++ b/console/src/utils/requestAction.ts @@ -11,7 +11,6 @@ import { CONNECTION_FAILED, } from '../components/App/Actions'; import { globalCookiePolicy } from '../Endpoints'; -import { getClientTypeHeader, requestTagHeader } from './client'; const requestAction = ( url: string, @@ -24,12 +23,6 @@ const requestAction = ( return (dispatch: any, getState: any) => { const requestOptions = { ...options }; - const currentClientType = getClientTypeHeader(); - requestOptions.headers = { - ...(options.headers || {}), - [requestTagHeader]: currentClientType, - }; - if (!options.credentials && includeCredentials) { requestOptions.credentials = globalCookiePolicy; }