arcjet / arcjet-js

Arcjet JS SDKs. Bot detection, rate limiting, email validation, attack protection, data redaction for Node.js, Next.js, Deno, Bun, SvelteKit, NestJS.
https://arcjet.com
Apache License 2.0
267 stars 7 forks source link

Create NextJS pages router example for `sensitiveInfo` rule #1399

Open e-moran opened 2 months ago

e-moran commented 2 months ago

We want to add an example to ensure that this continues to work correctly in to the future. We also need to check that it works correctly if body parsing is disabled, and perhaps add readBody if it does not.

According to https://nextjs.org/docs/pages/building-your-application/routing/api-routes#request-helpers, it seems that you'll have a stream-like object if it is disabled.