File tree Expand file tree Collapse file tree
src/app/.well-known/[...path] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { test , expect } from "@playwright/test" ;
2+
3+ test . describe ( ".well-known" , ( ) => {
4+ test ( "should return 404 for .well-known/security.txt" , async ( { page } ) => {
5+ const response = await page . goto (
6+ "http://localhost:3000/.well-known/security.txt"
7+ ) ;
8+ expect ( response . status ( ) ) . toBe ( 404 ) ;
9+ } ) ;
10+
11+ test ( "should return 404 for .well-known/apple-app-site-association" , async ( {
12+ page
13+ } ) => {
14+ const response = await page . goto (
15+ "http://localhost:3000/.well-known/apple-app-site-association"
16+ ) ;
17+ expect ( response . status ( ) ) . toBe ( 404 ) ;
18+ } ) ;
19+
20+ test ( "should return 404 for .well-known/change-password" , async ( {
21+ page
22+ } ) => {
23+ const response = await page . goto (
24+ "http://localhost:3000/.well-known/change-password"
25+ ) ;
26+ expect ( response . status ( ) ) . toBe ( 404 ) ;
27+ } ) ;
28+
29+ test ( "should return 404 for any .well-known path" , async ( { page } ) => {
30+ const response = await page . goto (
31+ "http://localhost:3000/.well-known/any/arbitrary/path"
32+ ) ;
33+ expect ( response . status ( ) ) . toBe ( 404 ) ;
34+ } ) ;
35+ } ) ;
Original file line number Diff line number Diff line change 1+ /**
2+ * Returns 404 for all requests to .well-known paths
3+ */
4+ export async function GET ( ) {
5+ return new Response ( null , { status : 404 } ) ;
6+ }
7+
8+ export async function POST ( ) {
9+ return new Response ( null , { status : 404 } ) ;
10+ }
11+
12+ export async function PUT ( ) {
13+ return new Response ( null , { status : 404 } ) ;
14+ }
15+
16+ export async function DELETE ( ) {
17+ return new Response ( null , { status : 404 } ) ;
18+ }
19+
20+ export async function PATCH ( ) {
21+ return new Response ( null , { status : 404 } ) ;
22+ }
23+
24+ export async function HEAD ( ) {
25+ return new Response ( null , { status : 404 } ) ;
26+ }
27+
28+ export async function OPTIONS ( ) {
29+ return new Response ( null , { status : 404 } ) ;
30+ }
You can’t perform that action at this time.
0 commit comments