page 추가

This commit is contained in:
ljpark
2025-10-27 20:26:05 +09:00
parent 0fd1fa74ba
commit 762c97d186
2 changed files with 31 additions and 9 deletions
+9 -9
View File
@@ -36,15 +36,15 @@ function rewriteWith(url: string, req: NextRequest, withAuth = false): NextRespo
const headers = withAuth ? buildAuthHeaders(req) : new Headers(req.headers);
if (url.indexOf("/operation-service") !== -1) {
// x-forwarded- 로 시작하는 헤더의 첫 번째 값만 남김
for (const [key, value] of headers.entries()) {
if (key.startsWith('x-forwarded-') && value.includes(',')) {
const first = (value?.split(',')[0] || '').trim();
headers.set(key, first);
}
}
}
// if (url.indexOf("/operation-service") !== -1) {
// // x-forwarded- 로 시작하는 헤더의 첫 번째 값만 남김
// for (const [key, value] of headers.entries()) {
// if (key.startsWith('x-forwarded-') && value.includes(',')) {
// const first = (value?.split(',')[0] || '').trim();
// headers.set(key, first);
// }
// }
// }
return NextResponse.rewrite(new URL(url), { headers });
}