Skip to content

Commit bbc55b1

Browse files
authored
Merge branch 'canary' into build/analysis-gssp
2 parents a616d28 + 29582c8 commit bbc55b1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/next/server/base-server.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,18 @@ export default abstract class Server<ServerOptions extends Options = Options> {
15781578
if (result !== false) return result
15791579
}
15801580
}
1581+
1582+
// currently edge functions aren't receiving the x-matched-path
1583+
// header so we need to fallback to matching the current page
1584+
// when we weren't able to match via dynamic route to handle
1585+
// the rewrite case
1586+
// @ts-expect-error extended in child class web-server
1587+
if (this.serverOptions.webServerConfig) {
1588+
// @ts-expect-error extended in child class web-server
1589+
ctx.pathname = this.serverOptions.webServerConfig.page
1590+
const result = await this.renderPageComponent(ctx, bubbleNoFallback)
1591+
if (result !== false) return result
1592+
}
15811593
} catch (error) {
15821594
const err = getProperError(error)
15831595

0 commit comments

Comments
 (0)