Comparing version 4.5.0 to 4.6.0
19
index.js
@@ -24,2 +24,9 @@ var rawBody = require("raw-body") | ||
if (opts.cache && req.__rawBody__) { | ||
process.nextTick(function() { | ||
callback(null, req.__rawBody__); | ||
}); | ||
return; | ||
} | ||
rawBody(req, { | ||
@@ -29,3 +36,13 @@ limit: limit, | ||
encoding: "encoding" in opts ? opts.encoding : true | ||
}, callback) | ||
}, function onRawBody(err, string) { | ||
if (!err && opts.cache) { | ||
Object.defineProperty(req, '__rawBody__', { | ||
configurable: true, | ||
enumerable: false, | ||
value: string | ||
}); | ||
} | ||
callback(err, string); | ||
}); | ||
} |
{ | ||
"name": "body", | ||
"version": "4.5.0", | ||
"version": "4.6.0", | ||
"description": "Body parsing", | ||
@@ -26,2 +26,3 @@ "keywords": [], | ||
"after": "~0.7.0", | ||
"hammock": "^1.0.0", | ||
"test-server": "~0.1.3", | ||
@@ -39,4 +40,4 @@ "send-data": "~1.0.1", | ||
"scripts": { | ||
"test": "node ./test/integration.js" | ||
"test": "node ./test/index.js" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18012
13
255
6