We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edbd24c commit 62fe653Copy full SHA for 62fe653
1 file changed
lib/requestHandler.js
@@ -422,7 +422,18 @@ function getUserReqHandler(userRule, recorder) {
422
423
try {
424
resourceInfo.reqBody = reqData.toString(); //TODO: deal reqBody in webInterface.js
425
- recorder && recorder.updateRecord(resourceInfoId, resourceInfo);
+
426
+ if (/gzip/i.test(resourceInfo.req.headers['Content-Encoding'])) {
427
+ zlib.gunzip(reqData, (error, gunzipped) => {
428
+ if (error) throw error;
429
+ resourceInfo.reqBody = gunzipped.toString();
430
+ recorder && recorder.updateRecord(resourceInfoId, resourceInfo);
431
+ });
432
+ } else {
433
+ resourceInfo.reqBody = reqData.toString(); //TODO: deal reqBody in webInterface.js
434
435
+ }
436
437
} catch (e) { }
438
})
439
0 commit comments