HTTP Gzip will search for gzip, otherwise return the original message.

This commit is contained in:
windhamwong@nva-hk.com 2017-07-12 13:48:08 +01:00
parent b9d33c0618
commit 8ce8fac26c

View file

@ -267,6 +267,7 @@ const Compress = {
let regexStr = /1f8b080[0-8][0-9a-f]{12}/;
let gzipPos = input.search(regexStr);
if (gzipPos == -1) {return Utils.hexToByteArray(input);}
let plainData = input.substr(0, gzipPos);
let gzipData = input.substr(gzipPos);