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
@@ -0,0 +1,22 @@
"use client";
import React from "react";
export default function TestPage() {
const handleFindUser = () => {
fetch('/operation-service/api/v1/fclt/flow/1/10/2024', {
method: "GET",
}).then((data) => {
console.log(data);
});
};
return (
<div className="text-4xl">
<span>여기를 click</span>
<button onClick={handleFindUser} className="bg-blue-500 hover:bg-blue-700 text-white">
버튼
</button>
</div>
);
}
+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 });
}