Skip to content

Commit

Permalink
(feat) Blackhole .well-known/ requests (#53)
Browse files Browse the repository at this point in the history
* (feat) Blackhole .well-known/ requests

No need to pay for nice 404 on those.
Nor issue a cms request.

* (chore) Add cs
  • Loading branch information
nitriques authored Feb 5, 2025
1 parent a850bea commit a9ae3d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-wolves-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@288-toolkit/hooks': minor
---

Blackhole .well-known/ requests
5 changes: 5 additions & 0 deletions packages/hooks/src/server/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export const preflightCheck: Handle = ({ event, resolve }) => {
return error404();
}

// Empty responses for .well-known/ requests
if (event.url.pathname.startsWith('/.well-known/')) {
return error404();
}

return resolve(event);
};

Expand Down

0 comments on commit a9ae3d0

Please sign in to comment.