diff options
Diffstat (limited to 'app')
| -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) ); |
