Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N21-1329 adds gzip as encoding for provisioning data request #4513

Merged
merged 10 commits into from
Nov 3, 2023
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' }),
Dismissed Show dismissed Hide dismissed
})
);
});

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
Loading