From 4ab7145ca5a2246cc9bfbcceef7f113a70c6ccc1 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sat, 23 Nov 2024 18:02:10 +0200 Subject: [PATCH] add security.txt --- .../security.txt/+server.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/routes/[...wellKnown=wellKnown]/security.txt/+server.ts diff --git a/src/routes/[...wellKnown=wellKnown]/security.txt/+server.ts b/src/routes/[...wellKnown=wellKnown]/security.txt/+server.ts new file mode 100644 index 0000000..636b8cd --- /dev/null +++ b/src/routes/[...wellKnown=wellKnown]/security.txt/+server.ts @@ -0,0 +1,29 @@ +export const GET = () => { + const date = new Date(); + date.setMonth(date.getMonth() + 6); + date.setDate(1); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + date.setMilliseconds(0); + + return new Response( + `# If you would like to report a security issue +# you may report it to: +Contact: mailto:evert@lunasqu.ee + +# GnuPG public key +Encryption: https://lunasqu.ee/public/keys/pgp/Evert%20Prants.pub + +# English and Estonian +Preferred-Languages: en, et + +Expires: ${date.toISOString()} +`, + { + headers: { + 'content-type': 'text/plain' + } + } + ); +};