Skip to content

Commit

Permalink
Update customized headers
Browse files Browse the repository at this point in the history
  • Loading branch information
cwhuang29 committed May 28, 2023
1 parent 88214ee commit 07f6660
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/shared/services/roots.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const httpConfig = {
xsrfCookieName: 'csrftoken', // The name of the cookie to use as a value for xsrf token
timeout: 30000, // If the request takes longer than `timeout`, the request will be aborted (Error: timeout of 1000ms exceeded)
transformResponse: [data => ({ ...JSON.parse(data) })], // Changes to the response to be made before it is passed to then/catch
headers: { 'X-VH-Source': 'extension' }, // Custom headers to be sent
headers: { 'X-VH-Platform': 'web', 'X-VH-Source': 'extension' },
};

const fetch = axios.create(httpConfig);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/utils/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import config from '@/config';

import { getAuthTokenFromStorage } from './auth';

export const headers = { 'Content-Type': 'application/json', 'X-VH-Source': 'extension' };
export const headers = { 'Content-Type': 'application/json', 'X-VH-Source': 'extension', 'X-VH-Platform': 'web' };

export const getEndpointUrl = ({ path }) => `${config.backendURL}${path}`;

Expand Down

0 comments on commit 07f6660

Please sign in to comment.