From bc39549bcc2c863fc569ace324a237df0ee03ebb Mon Sep 17 00:00:00 2001 From: swcho Date: Tue, 21 Oct 2025 15:17:19 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20sn=20=EC=BB=A4=EB=B0=8B=20=EB=A1=A4?= =?UTF-8?q?=EB=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/.env.local | 4 ++-- apps/sn/middleware.ts | 15 ++------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/apps/sn/.env.local b/apps/sn/.env.local index 6cde78209..41b18da0c 100644 --- a/apps/sn/.env.local +++ b/apps/sn/.env.local @@ -11,9 +11,9 @@ NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver #NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr/openapi/Gettile.do?apiKey=04trYP9_xwLAfALjwZ-B8g NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr/openapi/Gettile.do?apiKey=04trYP9_xwLAfALjwZ-B8g&layer=korean_map&TileMatrix={z}&TileCol={x}&TileRow={y} NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 -# NEXT_PUBLIC_SEWERAGE_API_URL = http://con.mind-one.co.kr:11083 +NEXT_PUBLIC_SEWERAGE_API_URL = http://con.mind-one.co.kr:11083 NEXT_PUBLIC_DC_URL = https://apigateway.apps.rsonesoft.com NEXT_PUBLIC_CM_LOGIN_PAGE_URL = http://dev.onasys.co.kr:3000/auth/login #NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.128:8883 #NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.222:8883 -NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883 +# NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883 diff --git a/apps/sn/middleware.ts b/apps/sn/middleware.ts index 8d20a60c0..9851437b1 100644 --- a/apps/sn/middleware.ts +++ b/apps/sn/middleware.ts @@ -104,20 +104,9 @@ export function middleware(req: NextRequest) { || pathname.startsWith("/cms-service") || pathname.startsWith("/user-service") ) { - const requestHeaders = new Headers(req.headers); - const token = req.cookies.get(CLAIM_NAME)?.value; - const userId = req.cookies.get(AUTH_USER_ID)?.value; const newUrl = `${SERVER_API_URL}${pathname}`; - - if (token) requestHeaders.set(CLAIM_NAME, token); - if (userId) requestHeaders.set(AUTH_USER_ID, userId); - - console.log( - `[Middleware] Rewriting from '/attach-service' path to: ${newUrl}`, - ); - return NextResponse.rewrite(new URL(newUrl), { - headers: requestHeaders, - }); + console.log(`[Middleware] Rewriting from '/attach-service' path to: ${newUrl}`); + return rewriteWith(newUrl, req, true); } if (pathname.startsWith("/dc-service")) {