Skip to content

Commit

Permalink
N21-1329 adds gzip as encoding for provisioning data request (#4513)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnegns authored Nov 3, 2023
1 parent 8da2a40 commit 0d2718d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,21 @@ describe('SanisStrategy', () => {
provisioningUrl,
expect.objectContaining({
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
headers: expect.objectContaining({ Authorization: 'Bearer sanisAccessToken' }),
headers: expect.objectContaining({ Authorization: 'Bearer sanisAccessToken', 'Accept-Encoding': 'gzip' }),
})
);
});

it('should accept gzip compressed data', async () => {
const { input, provisioningUrl } = setup();

await strategy.getData(input);

expect(httpService.get).toHaveBeenCalledWith(
provisioningUrl,
expect.objectContaining({
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
headers: expect.objectContaining({ 'Accept-Encoding': 'gzip' }),
})
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export class SanisProvisioningStrategy extends OidcProvisioningStrategy {
}

const axiosConfig: AxiosRequestConfig = {
headers: { Authorization: `Bearer ${input.accessToken}` },
headers: {
Authorization: `Bearer ${input.accessToken}`,
'Accept-Encoding': 'gzip',
},
};

const axiosResponse: AxiosResponse<SanisResponse> = await firstValueFrom(
Expand Down

0 comments on commit 0d2718d

Please sign in to comment.