From c68d4307fd0a595ed3cd3ae8c8d44a1e625113c1 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sun, 3 Nov 2024 12:05:38 +0000 Subject: [PATCH] style: remove trailing whitespace (#170) --- README.md | 4 ++-- examples/example.mjs | 4 ++-- types/index.test-d.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2ef3e85..8c054ce 100644 --- a/README.md +++ b/README.md @@ -199,14 +199,14 @@ function getToken (req) { It is recommended to provide a custom `getToken` function for performance and [security](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#use-of-custom-request-headers) reasons. ```js -fastify.register(require('@fastify/csrf-protection'), +fastify.register(require('@fastify/csrf-protection'), { getToken: function (req) { return req.headers['csrf-token'] } } ) ``` or ```js -fastify.register(require('@fastify/csrf-protection'), +fastify.register(require('@fastify/csrf-protection'), { getToken: (req) => req.headers['csrf-token'] } ) ``` diff --git a/examples/example.mjs b/examples/example.mjs index 4c56255..f7a49d6 100644 --- a/examples/example.mjs +++ b/examples/example.mjs @@ -41,7 +41,7 @@ fastify.route({ body: JSON.stringify({ _csrf: '${token}'}) }); const content = await rawResponse.json(); - + alert(JSON.stringify(content)); } @@ -51,7 +51,7 @@ fastify.route({ - + ` } }) diff --git a/types/index.test-d.ts b/types/index.test-d.ts index f10a62a..30e19ff 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -34,7 +34,7 @@ async function run() { return req.body } }) - + fastify.addHook('onRequest', fastify.csrfProtection) }