shamoon 2 лет назад
Родитель
Сommit
abcea88d0a
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      src/utils/proxy/http.js

+ 7 - 0
src/utils/proxy/http.js

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