do not unzip the response body when it's empty, such as 304

also remove the delete operatoin for 'accept-encoding' in the test utils, since AnyProxy will not remove the header now
This commit is contained in:
砚然
2017-12-14 23:58:52 +08:00
parent 87c4eeec94
commit b6c7088965
5 changed files with 37 additions and 13 deletions

View File

@@ -130,13 +130,6 @@ function isCommonReqEqual(url, serverInstance) {
isEqual = isEqual && proxyReqObj.headers['via-proxy'] === 'true';
delete proxyReqObj.headers['via-proxy'];
// exclued accept-encoding from comparing, since the proxy will remove it before sending it out
delete directReqObj.headers['accept-encoding'];
// TODO: 我这里proxy出去的options里没有accept-encoding, 但node自己加上了。Why ?
// By 加里 2017.1.31
delete proxyReqObj.headers['accept-encoding'];
directReqObj.headers['content-type'] = trimFormContentType(directReqObj.headers['content-type']);
proxyReqObj.headers['content-type'] = trimFormContentType(proxyReqObj.headers['content-type']);