diff --git a/src/build/content/server.ts b/src/build/content/server.ts index fbd289533c..e5beb3ef54 100644 --- a/src/build/content/server.ts +++ b/src/build/content/server.ts @@ -111,6 +111,7 @@ export const copyNextServerCode = async (ctx: PluginContext): Promise => { ], { cwd: srcDir, + dot: true, extglob: true, }, ) diff --git a/tests/e2e/simple-app.test.ts b/tests/e2e/simple-app.test.ts index a18a83c3a4..fb790afcff 100644 --- a/tests/e2e/simple-app.test.ts +++ b/tests/e2e/simple-app.test.ts @@ -342,3 +342,12 @@ test.describe('RSC cache poisoning', () => { expect(htmlResponse?.headers()['debug-netlify-cdn-cache-control']).toMatch(/s-maxage=31536000/) }) }) + +test('Handles route with a path segment starting with dot correctly', async ({ simple }) => { + const response = await fetch(`${simple.url}/.well-known/farcaster`) + + expect(response.status).toBe(200) + + const data = await response.json() + expect(data).toEqual({ msg: 'Hi!' }) +}) diff --git a/tests/fixtures/simple/app/.well-known/farcaster/route.js b/tests/fixtures/simple/app/.well-known/farcaster/route.js new file mode 100644 index 0000000000..2bbd2710f9 --- /dev/null +++ b/tests/fixtures/simple/app/.well-known/farcaster/route.js @@ -0,0 +1,9 @@ +import { NextResponse } from 'next/server' + +export async function GET() { + return NextResponse.json({ + msg: 'Hi!', + }) +} + +export const dynamic = 'force-dynamic'