File tree 2 files changed +1
-11
lines changed
2 files changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -185,13 +185,3 @@ function flattenPages(
185
185
186
186
return result ;
187
187
}
188
-
189
- /**
190
- * Returns a page not found if the request is not from the middleware.
191
- * Some pages can be
192
- */
193
- export async function checkIsFromMiddleware ( ) {
194
- const headerList = await headers ( ) ;
195
- // To check if the request is from the middleware, we check if the x-gitbook-token is set in the headers.
196
- return Boolean ( headerList . get ( 'x-gitbook-token' ) ) ;
197
- }
Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ export async function middleware(request: NextRequest) {
277
277
headers . set ( 'x-gitbook-visitor-token' , resolved . visitorToken ) ;
278
278
}
279
279
280
- const target = new URL ( '/middleware' + rewritePathname , request . nextUrl . toString ( ) ) ;
280
+ const target = new URL ( joinPath ( '/middleware' , rewritePathname ) , request . nextUrl . toString ( ) ) ;
281
281
target . search = url . search ;
282
282
283
283
const response = writeCookies (
You can’t perform that action at this time.
0 commit comments