Skip to content

Commit

Permalink
Revert "Merge pull request RedHatInsights#2844 from Hyperkid123/fe-re…
Browse files Browse the repository at this point in the history
…quest-origin-header"

This reverts commit e8daa00, reversing
changes made to babf03a.
  • Loading branch information
florkbr committed May 29, 2024
1 parent e8daa00 commit be2ce49
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/utils/iqeEnablement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { gatewayErrorAtom } from '../state/atoms/gatewayErrorAtom';
let xhrResults: XMLHttpRequest[] = [];
let fetchResults: Record<string, unknown> = {};

// this extra header helps with API metrics
const FE_ORIGIN_HEADER_NAME = 'x-rh-frontend-origin';
const DENIED_CROSS_CHECK = 'Access denied from RBAC on cross-access check';
const AUTH_ALLOWED_ORIGINS = [
location.origin,
Expand Down Expand Up @@ -106,8 +104,6 @@ export function init(chromeStore: ReturnType<typeof createStore>, authRef: React
// Send Auth header, it will be changed to Authorization later down the line
this.setRequestHeader('Auth', `Bearer ${authRef.current.user?.access_token}`);
}

this.setRequestHeader(FE_ORIGIN_HEADER_NAME, 'hcc');
}
// eslint-disable-line func-names
if (iqeEnabled) {
Expand Down Expand Up @@ -140,10 +136,6 @@ export function init(chromeStore: ReturnType<typeof createStore>, authRef: React
request.headers.append('Authorization', `Bearer ${authRef.current.user?.access_token}`);
}

if (!request.headers.has(FE_ORIGIN_HEADER_NAME)) {
request.headers.append(FE_ORIGIN_HEADER_NAME, 'hcc');
}

const prom = oldFetch.apply(this, [request, ...rest]);
if (iqeEnabled) {
fetchResults[tid] = arguments[0];
Expand Down

0 comments on commit be2ce49

Please sign in to comment.