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

@@ -103,6 +103,11 @@ KoaServer.prototype.constructRouter = function () {
});
});
router.get('/test/response/304', this.logRequest, function *(next) {
this.response.set('Content-Encoding', 'gzip');
this.status = 304;
});
router.get('/test/response/303', function *(next) {
printLog('now to redirect 303');
this.redirect('/test');