Skip to content

Commit

Permalink
fix template invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Oct 13, 2023
1 parent bbd95c1 commit 2151b86
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export default async function middlewareLoader(this: any) {
middlewareConfig: middlewareConfigBase64,
}: MiddlewareLoaderOptions = this.getOptions()
const matchers = encodedMatchers ? decodeMatchers(encodedMatchers) : undefined
const stringifiedPagePath = stringifyRequest(this, absolutePagePath)
const pagePath = this.utils.contextify(
this.context || this.rootContext,
absolutePagePath
)

const middlewareConfig: MiddlewareConfig = JSON.parse(
Buffer.from(middlewareConfigBase64, 'base64').toString()
)
Expand All @@ -57,7 +61,7 @@ export default async function middlewareLoader(this: any) {
}

return await loadEntrypoint('middleware', {
VAR_USERLAND: stringifiedPagePath,
VAR_USERLAND: pagePath,
VAR_DEFINITION_PAGE: page,
})
}

0 comments on commit 2151b86

Please sign in to comment.