Skip to content

Commit

Permalink
Fix issue with newer axios clients by passing Accept-Encoding header,…
Browse files Browse the repository at this point in the history
  • Loading branch information
thesocialdev committed Feb 16, 2023
1 parent 1b33bbb commit 10ba7c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/unleash-client/features/features-client.spec.ts
Expand Up @@ -26,6 +26,8 @@ describe('UnleashFeaturesClient', () => {
test('sendMetrics()', async () => {
await featuresClient.getFeatures()

expect(unleashClient.get).toHaveBeenCalledWith('/features')
expect(unleashClient.get).toHaveBeenCalledWith('/features', {
headers: { 'Accept-Encoding': 'gzip,deflate,compress' },
})
})
})
4 changes: 3 additions & 1 deletion src/unleash-client/features/features-client.ts
Expand Up @@ -7,6 +7,8 @@ export class UnleashFeaturesClient {
constructor(private readonly client: UnleashClient) {}

getFeatures(): Promise<GetFeaturesResponse> {
return this.client.get('/features')
return this.client.get('/features', {
headers: { 'Accept-Encoding': 'gzip,deflate,compress' },
})
}
}

0 comments on commit 10ba7c5

Please sign in to comment.