We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 297edf8 commit 168fcdbCopy full SHA for 168fcdb
packages/adapter-vercel/files/serverless.js
@@ -22,10 +22,12 @@ export default async (req, res) => {
22
const [path, search] = req.url.split('?');
23
24
const params = new URLSearchParams(search);
25
- const pathname = params.get('__pathname');
+ let pathname = params.get('__pathname');
26
27
if (pathname) {
28
params.delete('__pathname');
29
+ // Optional routes' pathname replacements look like `/foo/$1/bar` which means we could end up with an url like /foo//bar
30
+ pathname = pathname.replace(/\/+/g, '/');
31
req.url = `${pathname}${path.endsWith(DATA_SUFFIX) ? DATA_SUFFIX : ''}?${params}`;
32
}
33
0 commit comments