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.
x-now-route-matches
1 parent 6baa4ef commit c0ee44bCopy full SHA for c0ee44b
src/presets/vercel/runtime/vercel.web.ts
@@ -11,11 +11,13 @@ export default {
11
context: { waitUntil: (promise: Promise<any>) => void }
12
) {
13
// Check for ISR request
14
- const isrRoute = req.headers.get("x-now-route-matches");
15
- if (isrRoute) {
16
- const url = new URL(req.url);
17
- url.pathname = decodeURIComponent(isrRoute);
18
- req = new Request(url.toString(), req);
+ const query = req.headers.get("x-now-route-matches");
+ if (query) {
+ const urlParam = new URLSearchParams(query).get("url");
+ if (urlParam) {
+ const url = new URL(decodeURIComponent(urlParam), req.url).href;
19
+ req = new Request(url, req);
20
+ }
21
}
22
23
// srvx compatibility
0 commit comments