Skip to content

Commit

Permalink
fix bind
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed May 2, 2023
1 parent 782090b commit edefdc4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/next/src/server/next-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ export default class NextNodeServer extends BaseServer {
pageModule,
{
...this.renderOpts.previewProps,
revalidate: this.revalidate,
revalidate: this.revalidate.bind(this),
// internal config so is not typed
trustHostHeader: (this.nextConfig.experimental as Record<string, any>)
.trustHostHeader,
Expand Down Expand Up @@ -1679,13 +1679,12 @@ export default class NextNodeServer extends BaseServer {
revalidateHeaders: { [key: string]: string | string[] }
opts: { unstable_onlyGenerated?: boolean }
}) {
this.prepare()
const handler = this.getRequestHandler()

const mocked = createRequestResponseMocks({
url: urlPath,
headers: revalidateHeaders,
})

const handler = this.getRequestHandler()
await handler(
new NodeNextRequest(mocked.req),
new NodeNextResponse(mocked.res)
Expand Down

0 comments on commit edefdc4

Please sign in to comment.