body-fingerprint
Advanced tools
Comparing version 1.3.7 to 1.4.0
"use strict"; | ||
const clarinet = require("./lib/clarinet"); | ||
const { getEntropy } = require("./lib/entropy"); | ||
@@ -14,2 +15,3 @@ const multipartFingerprint = (req, _, next) => { | ||
}, | ||
entropy: null, | ||
}; | ||
@@ -59,2 +61,3 @@ | ||
.join(";"); | ||
req.multipart.entropy = getEntropy(req.multipart.raw.body); | ||
}); | ||
@@ -84,4 +87,2 @@ | ||
const _handle = new Int32Array(new SharedArrayBuffer(4)); | ||
try { | ||
@@ -94,2 +95,3 @@ if (depthFirstOrder) { | ||
let _error; | ||
const _handle = new Int32Array(new SharedArrayBuffer(4)); | ||
@@ -110,3 +112,3 @@ new Promise(() => { | ||
parser.write(req.json.raw.body).close(); | ||
}); | ||
}).catch(new Function()); | ||
@@ -152,2 +154,3 @@ Atomics.wait(_handle, 0, 0); | ||
); | ||
req.json.entropy = getEntropy(req.json.raw.body); | ||
@@ -154,0 +157,0 @@ next(); |
{ | ||
"name": "body-fingerprint", | ||
"version": "1.3.7", | ||
"version": "1.4.0", | ||
"description": "Tracks consumers by POST body", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -164,2 +164,10 @@ # body-fingerprint | ||
## Entropy | ||
A property value representing Shannon entropy. `null` by default | ||
- For multipart access through `req.multipart.entropy` | ||
- For JSON access through `req.json.entropy` | ||
## Test | ||
@@ -166,0 +174,0 @@ |
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
32682
5
751
177
1