page 추가
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user