diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-11-20 00:51:22 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-11-20 00:51:22 +0000 |
| commit | 4f36374bde6f40b160665e126c9f1d6ecd808055 (patch) | |
| tree | 374129c951860be638e00afdf0959e174833cd6c /app/api/files | |
| parent | a2681dd8fd6b1f722ff7c7573fa7486ddd1fbbcc (diff) | |
(임수민) params 에러 수정
Diffstat (limited to 'app/api/files')
| -rw-r--r-- | app/api/files/[...path]/route.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/api/files/[...path]/route.ts b/app/api/files/[...path]/route.ts index 38e76298..90c95458 100644 --- a/app/api/files/[...path]/route.ts +++ b/app/api/files/[...path]/route.ts @@ -66,11 +66,12 @@ const isAllowedPath = (requestedPath: string): boolean => { export async function GET( request: NextRequest, - { params }: { params: { path: string[] } } + { params }: { params: Promise<{ path: string[] }> } ) { try { // 요청된 파일 경로 구성 - const decodedPath = params.path.map(segment => + const resolvedParams = await params; + const decodedPath = resolvedParams.path.map(segment => decodeURIComponent(segment) ); @@ -192,10 +193,11 @@ export async function GET( // HEAD 요청 지원 (파일 정보만 확인) export async function HEAD( request: NextRequest, - { params }: { params: { path: string[] } } + { params }: { params: Promise<{ path: string[] }> } ) { try { - const decodedPath = params.path.map(segment => + const resolvedParams = await params; + const decodedPath = resolvedParams.path.map(segment => decodeURIComponent(segment) ); |
