Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
franck34 committed Mar 28, 2020
1 parent edbd24c commit 62fe653
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/requestHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,18 @@ function getUserReqHandler(userRule, recorder) {

try {
resourceInfo.reqBody = reqData.toString(); //TODO: deal reqBody in webInterface.js
recorder && recorder.updateRecord(resourceInfoId, resourceInfo);

if (/gzip/i.test(resourceInfo.req.headers['Content-Encoding'])) {
zlib.gunzip(reqData, (error, gunzipped) => {
if (error) throw error;
resourceInfo.reqBody = gunzipped.toString();
recorder && recorder.updateRecord(resourceInfoId, resourceInfo);
});
} else {
resourceInfo.reqBody = reqData.toString(); //TODO: deal reqBody in webInterface.js
recorder && recorder.updateRecord(resourceInfoId, resourceInfo);
}

} catch (e) { }
})

Expand Down

0 comments on commit 62fe653

Please sign in to comment.