Skip to content

Commit 94b98a8

Browse files
committed
revert to original middleware implementation
1 parent bd06a7e commit 94b98a8

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

middleware.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,8 @@
1-
import { NextResponse } from "next/server"
21
import createMiddleware from "next-intl/middleware"
32

43
import { routing } from "./src/i18n/routing"
54

6-
// Create the base middleware
7-
const intlMiddleware = createMiddleware(routing)
8-
9-
// Wrap it with our debugging middleware
10-
export default async function middleware(request) {
11-
// Use console.log for Edge Runtime compatible logging
12-
console.log("\n🔍 MIDDLEWARE DEBUG START")
13-
console.log(`📥 Original URL: ${request.url}`)
14-
console.log(`📥 Original pathname: ${request.nextUrl.pathname}`)
15-
console.log(`🌐 Default locale: ${routing.defaultLocale}`)
16-
17-
// Skip middleware for static files and API routes
18-
if (
19-
request.nextUrl.pathname.startsWith("/_next") ||
20-
request.nextUrl.pathname.startsWith("/api") ||
21-
request.nextUrl.pathname.includes(".")
22-
) {
23-
console.log("⏭️ Skipping middleware for static/API route")
24-
return NextResponse.next()
25-
}
26-
27-
// Call the next-intl middleware for all paths
28-
const response = await intlMiddleware(request)
29-
30-
// Log the response
31-
console.log(`📤 Redirect URL: ${response.headers.get("location")}`)
32-
console.log(`📤 Response status: ${response.status}`)
33-
console.log(
34-
`📤 Response headers: ${JSON.stringify(Object.fromEntries(response.headers), null, 2)}`
35-
)
36-
console.log("🔍 MIDDLEWARE DEBUG END\n")
37-
38-
return response
39-
}
5+
export default createMiddleware(routing)
406

417
// Simplified matcher pattern
428
export const config = {

0 commit comments

Comments
 (0)