diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-12-09 10:59:54 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-12-09 10:59:54 +0000 |
| commit | 6c3edc483de65e2666e2ede764daa900a7cc2b4b (patch) | |
| tree | ea92913e15bda9519fd9fdbeaa99ab1377102845 | |
| parent | 09858255bcea648c01939447233fea9e955a36ee (diff) | |
| -rw-r--r-- | middleware.ts | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/middleware.ts b/middleware.ts index 4e222e6c..493c9adc 100644 --- a/middleware.ts +++ b/middleware.ts @@ -213,6 +213,15 @@ export async function middleware(request: NextRequest) { } const { pathname, searchParams, origin } = request.nextUrl; + + /** + * 2-1. TrustNet 등 정적 경로는 언어 경로 추가하지 않고 그대로 통과 (최우선 처리) + * TrustNet은 Tomcat 서버에서 처리되므로 Next.js middleware가 개입하지 않음 + */ + if (pathname.startsWith('/trustnet')) { + console.log('[Middleware] TrustNet 경로 감지, 통과:', pathname, 'query:', searchParams.toString()); + return NextResponse.next(); + } /** * 3. "/" 경로로 들어온 경우 -> "/{lng}"로 리다이렉트 @@ -224,14 +233,6 @@ export async function middleware(request: NextRequest) { } /** - * 3-1. TrustNet 등 정적 경로는 언어 경로 추가하지 않고 그대로 통과 - * TrustNet은 Tomcat 서버에서 처리되므로 Next.js middleware가 개입하지 않음 - */ - if (pathname.startsWith('/trustnet')) { - return NextResponse.next(); - } - - /** * 4. 현재 pathname이 언어 경로를 포함하고 있는지 확인 */ const hasValidLngInPath = languages.some( |
