Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
internals.common.forEach((header) => {
this._common.set(header, Accept.encoding(header, this.encodings));
});
}
accept(request) {
const header = request.headers['accept-encoding'];
if (!header) {
return 'identity';
}
const common = this._common.get(header);
if (common) {
return common;
}
try {
return Accept.encoding(header, this.encodings);
}
catch (err) {
Bounce.rethrow(err, 'system');
err.header = header;
request._log(['accept-encoding', 'error'], err);
return 'identity';
}
}