Open
Description
Bug Report
Current behavior
Using NextJS 13.4, using API routes (Pages Folder) in the following folder structure:
pages/api/[...name].jsx
When i try to use the method getAll()
on the route BASE_URL/api/first-segment/second-segment
:
const { searchParams } = new URL(req.url);
const allSegments = searchParams.getAll('name')
the expected return from getAll()
was to be an array like:
[
'first-segment',
'second-segment'
]
This works correct in localhost
and in chrome js console.
However, when pushing to production (edge runtime), it gives the following code:
[
'first-segment/second-segment',
]
... which is different from the Web API implementation.
Expected behavior/code
From the example above, searchParams.getAll(param)
was expected to return an array with two items. It returned one array with only one item.