|
|
@ -33,15 +33,13 @@ function handleRequest(requestor, url, params) {
|
|
|
|
const contentEncoding = response.headers['content-encoding']?.trim().toLowerCase();
|
|
|
|
const contentEncoding = response.headers['content-encoding']?.trim().toLowerCase();
|
|
|
|
|
|
|
|
|
|
|
|
let responseContent = response;
|
|
|
|
let responseContent = response;
|
|
|
|
|
|
|
|
if (contentEncoding === 'gzip' || contentEncoding === 'deflate') {
|
|
|
|
|
|
|
|
responseContent = createUnzip();
|
|
|
|
// zlib errors
|
|
|
|
// zlib errors
|
|
|
|
responseContent.on("error", (e) => {
|
|
|
|
responseContent.on("error", (e) => {
|
|
|
|
logger.error(e);
|
|
|
|
logger.error(e);
|
|
|
|
responseContent = response; // fallback
|
|
|
|
responseContent = response; // fallback
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (contentEncoding === 'gzip' || contentEncoding === 'deflate') {
|
|
|
|
|
|
|
|
responseContent = createUnzip();
|
|
|
|
|
|
|
|
response.pipe(responseContent);
|
|
|
|
response.pipe(responseContent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|