Skip to content

Commit

Permalink
Patch encoding header issue for some integrations for getting their apps
Browse files Browse the repository at this point in the history
  • Loading branch information
dangtony98 committed Feb 7, 2023
1 parent 747cc11 commit aba8feb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions backend/src/integrations/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ const getAppsRender = async ({
const res = (
await axios.get(`${INTEGRATION_RENDER_API_URL}/v1/services`, {
headers: {
Authorization: `Bearer ${accessToken}`
Authorization: `Bearer ${accessToken}`,
Accept: 'application/json',
'Accept-Encoding': 'application/json'
}
})
).data;
Expand All @@ -272,6 +274,7 @@ const getAppsRender = async ({
name: a.service.name,
appId: a.service.id
}));

} catch (err) {
Sentry.setUser(null);
Sentry.captureException(err);
Expand Down Expand Up @@ -311,7 +314,9 @@ const getAppsFlyio = async ({
url: INTEGRATION_FLYIO_API_URL,
method: 'post',
headers: {
'Authorization': 'Bearer ' + accessToken
'Authorization': 'Bearer ' + accessToken,
'Accept': 'application/json',
'Accept-Encoding': 'application/json'
},
data: {
query,
Expand Down
3 changes: 2 additions & 1 deletion backend/src/integrations/exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ const exchangeCodeGithub = async ({ code }: { code: string }) => {
redirect_uri: `${SITE_URL}/integrations/github/oauth2/callback`
},
headers: {
Accept: 'application/json'
'Accept': 'application/json',
'Accept-Encoding': 'application/json'
}
})
).data;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/integrations/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default function Integrations() {
const integrationOptionPress = async (integrationOption: IntegrationOption) => {
try {
const integrationAuthX = integrationAuths.find((integrationAuth) => integrationAuth.integration === integrationOption.slug);

if (!bot.isActive) {
await handleBotActivate();
}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/integrations/github/oauth2/callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import AuthorizeIntegration from "../../../api/integrations/authorizeIntegration

export default function GitHubOAuth2CallbackPage() {
const router = useRouter();

const { code, state } = queryString.parse(router.asPath.split('?')[1]);

useEffect(() => {
Expand Down

0 comments on commit aba8feb

Please sign in to comment.