diff --git a/src/account-settings/site-language/service.js b/src/account-settings/site-language/service.js index 66466949b..5b8c9f2ef 100644 --- a/src/account-settings/site-language/service.js +++ b/src/account-settings/site-language/service.js @@ -23,10 +23,15 @@ export async function patchPreferences(username, params) { export async function postSetLang(code) { const formData = new FormData(); + const requestConfig = { + headers: { + Accept: 'application/json', + 'X-Requested-With': 'XMLHttpRequest', + }, + }; + const url = `${getConfig().LMS_BASE_URL}/i18n/setlang/`; formData.append('language', code); await getAuthenticatedHttpClient() - .post(`${getConfig().LMS_BASE_URL}/i18n/setlang/`, formData, { - headers: { 'X-Requested-With': 'XMLHttpRequest' }, - }); + .post(url, formData, requestConfig); } diff --git a/src/account-settings/third-party-auth/data/service.js b/src/account-settings/third-party-auth/data/service.js index 344913ee7..f3d07e53c 100644 --- a/src/account-settings/third-party-auth/data/service.js +++ b/src/account-settings/third-party-auth/data/service.js @@ -16,8 +16,9 @@ export async function getThirdPartyAuthProviders() { } export async function postDisconnectAuth(url) { + const requestConfig = { headers: { Accept: 'application/json' } }; const { data } = await getAuthenticatedHttpClient() - .post(url) + .post(url, {}, requestConfig) .catch(handleRequestError); return data; }