test deflate content

This commit is contained in:
guox191
2019-03-23 14:51:01 +08:00
parent 763bdc07a2
commit 3a310b0c0e
3 changed files with 21 additions and 4 deletions

View File

@@ -120,7 +120,7 @@ function fetchRemoteResponse(protocol, options, reqData, config) {
// only do unzip when there is res data
if (ifServerGzipped && originContentLen) {
refactContentEncoding();
zlib.gunzip(serverResData, (err, buff) => { // TODO test case to cover
zlib.gunzip(serverResData, (err, buff) => {
if (err) {
rejectParsing(err);
} else {
@@ -129,7 +129,7 @@ function fetchRemoteResponse(protocol, options, reqData, config) {
});
} else if (isServerDeflated && originContentLen) {
refactContentEncoding();
zlib.inflateRaw(serverResData, (err, buff) => { // TODO test case to cover
zlib.inflateRaw(serverResData, (err, buff) => {
if (err) {
rejectParsing(err);
} else {