Patch encoding header issue for some integrations for getting their apps

This commit is contained in:
Tuan Dang
2023-02-08 01:28:46 +07:00
parent 747cc1134c
commit aba8feb985
4 changed files with 10 additions and 5 deletions
+7 -2
View File
@@ -262,7 +262,9 @@ const getAppsRender = async ({
const res = ( const res = (
await axios.get(`${INTEGRATION_RENDER_API_URL}/v1/services`, { await axios.get(`${INTEGRATION_RENDER_API_URL}/v1/services`, {
headers: { headers: {
Authorization: `Bearer ${accessToken}` Authorization: `Bearer ${accessToken}`,
Accept: 'application/json',
'Accept-Encoding': 'application/json'
} }
}) })
).data; ).data;
@@ -272,6 +274,7 @@ const getAppsRender = async ({
name: a.service.name, name: a.service.name,
appId: a.service.id appId: a.service.id
})); }));
} catch (err) { } catch (err) {
Sentry.setUser(null); Sentry.setUser(null);
Sentry.captureException(err); Sentry.captureException(err);
@@ -311,7 +314,9 @@ const getAppsFlyio = async ({
url: INTEGRATION_FLYIO_API_URL, url: INTEGRATION_FLYIO_API_URL,
method: 'post', method: 'post',
headers: { headers: {
'Authorization': 'Bearer ' + accessToken 'Authorization': 'Bearer ' + accessToken,
'Accept': 'application/json',
'Accept-Encoding': 'application/json'
}, },
data: { data: {
query, query,
+2 -1
View File
@@ -322,7 +322,8 @@ const exchangeCodeGithub = async ({ code }: { code: string }) => {
redirect_uri: `${SITE_URL}/integrations/github/oauth2/callback` redirect_uri: `${SITE_URL}/integrations/github/oauth2/callback`
}, },
headers: { headers: {
Accept: 'application/json' 'Accept': 'application/json',
'Accept-Encoding': 'application/json'
} }
}) })
).data; ).data;
+1 -1
View File
@@ -253,7 +253,7 @@ export default function Integrations() {
const integrationOptionPress = async (integrationOption: IntegrationOption) => { const integrationOptionPress = async (integrationOption: IntegrationOption) => {
try { try {
const integrationAuthX = integrationAuths.find((integrationAuth) => integrationAuth.integration === integrationOption.slug); const integrationAuthX = integrationAuths.find((integrationAuth) => integrationAuth.integration === integrationOption.slug);
if (!bot.isActive) { if (!bot.isActive) {
await handleBotActivate(); await handleBotActivate();
} }
@@ -7,7 +7,6 @@ import AuthorizeIntegration from "../../../api/integrations/authorizeIntegration
export default function GitHubOAuth2CallbackPage() { export default function GitHubOAuth2CallbackPage() {
const router = useRouter(); const router = useRouter();
const { code, state } = queryString.parse(router.asPath.split('?')[1]); const { code, state } = queryString.parse(router.asPath.split('?')[1]);
useEffect(() => { useEffect(() => {