mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What? Visiting an edge catch-all route incorrectly truncates multiple parameters ### Why? The params are currently coerced into a `ParsedURLQuery`-like format by calling `Object.fromEntries` on `searchParams`, but this doesn't consider multiple param values assigned to the same key ### How? Rather than use `fromEntries`, this uses an existing util to get the path into `ParsedURLQuery` format. Closes NEXT-1814 Fixes #59333
14 lines
250 B
TypeScript
14 lines
250 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
|
|
export const runtime = 'edge'
|
|
|
|
type Context = {
|
|
params: {
|
|
slug: string[]
|
|
}
|
|
}
|
|
|
|
export const GET = async (req: NextRequest, { params }: Context) => {
|
|
return NextResponse.json(params)
|
|
}
|