Some updates!

This commit is contained in:
QuiteAFancyEmerald 2021-11-29 22:02:24 -08:00
parent 47a843bbb8
commit df4ce2ae68
No known key found for this signature in database
GPG key ID: 14E10C9F7DC07318
1412 changed files with 188615 additions and 149532 deletions

View file

@ -1,22 +0,0 @@
const zlib = require('zlib');
function decompress(ctx) {
if (!ctx.body || !ctx.remoteResponse) return;
try {
switch(ctx.headers['content-encoding']) {
case 'br':
ctx.body = zlib.brotliDecompressSync(ctx.body);
break;
case 'gzip':
ctx.body = zlib.gunzipSync(ctx.body);
break;
case 'deflate':
ctx.body = zlib.inflateRawSync(ctx.body);
break;
};
} catch(err) {};
delete ctx.headers['content-encoding'];
return true;
};
module.exports = decompress;