From 7504a4cdaf567895a320d914e9fdb72768c3b8dc Mon Sep 17 00:00:00 2001 From: David Mytton Date: Fri, 9 Feb 2024 13:19:29 +0000 Subject: [PATCH] docs: Add minimum required fields for request details example --- arcjet/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arcjet/README.md b/arcjet/README.md index 0e7f94925..38291c8c0 100644 --- a/arcjet/README.md +++ b/arcjet/README.md @@ -61,11 +61,16 @@ const server = http.createServer(async function ( res: http.ServerResponse, ) { // Construct an object with Arcjet request details + const path = new URL(req.url || "", `http://${req.headers.host}`); const details = { ip: req.socket.remoteAddress, + method: req.method, + host: req.headers.host, + path: path.pathname, }; const decision = await aj.protect(details); + console.log(decision); if (decision.isDenied()) { res.writeHead(403, { "Content-Type": "application/json" });