Skip to content

Commit abcb564

Browse files
committed
fix: add explicit Accept-Encoding header to http requests
fixes #648
1 parent 4b42b48 commit abcb564

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

docs/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,10 @@ requests.
569569

570570
```js
571571
const DEFAULT_HTTP_OPTIONS = {
572-
headers: { 'User-Agent': `${pkg.name}/${pkg.version} (${pkg.homepage})` },
572+
headers: {
573+
'User-Agent': `${pkg.name}/${pkg.version} (${pkg.homepage})`,
574+
'Accept-Encoding': 'identity',
575+
},
573576
timeout: 3500,
574577
};
575578
```

lib/helpers/request.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ const setDefaults = (props, options) => {
3939
};
4040

4141
setDefaults([], {
42-
headers: { 'User-Agent': `${pkg.name}/${pkg.version} (${pkg.homepage})` },
42+
headers: {
43+
'User-Agent': `${pkg.name}/${pkg.version} (${pkg.homepage})`,
44+
'Accept-Encoding': 'identity',
45+
},
4346
timeout: 3500,
4447
});
4548

lib/issuer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ class Issuer {
138138
}
139139

140140
static async discover(uri) {
141-
142141
const wellKnownUri = resolveWellKnownUri(uri);
143142

144143
const response = await request.call(this, {

test/client/client_instance.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ describe('Client', () => {
210210
state: 'state',
211211
scope: 'openid profile email',
212212
}),
213-
).to.eql('https://op.example.com/auth?client_id=identifier&scope=openid%20profile%20email&response_type=code&state=state');
213+
).to.eql(
214+
'https://op.example.com/auth?client_id=identifier&scope=openid%20profile%20email&response_type=code&state=state',
215+
);
214216
});
215-
216217
});
217218

218219
describe('#endSessionUrl', function () {

0 commit comments

Comments
 (0)