page 추가
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
@@ -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