Skip to content

Commit c9dea94

Browse files
authored
V2: Add back redirect for trailing slash (#2928)
1 parent 1344754 commit c9dea94

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

packages/gitbook-v2/src/middleware.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const config = {
1515
matcher: [
1616
'/((?!_next/static|_next/image|~gitbook/static|~gitbook/revalidate|~gitbook/monitoring|~scalar/proxy).*)',
1717
],
18-
skipTrailingSlashRedirect: true,
1918
};
2019

2120
type URLWithMode = { url: URL; mode: 'url' | 'url-host' };

packages/gitbook/src/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export async function middleware(request: NextRequest) {
270270
// When the request is authenticated, we don't want to cache the response on the server.
271271
// Allow storing so that revalidation still happens with server.
272272
if (!resolved.visitorToken) {
273-
return 'no-cache';
273+
return 'no-cache, no-store';
274274
}
275275

276276
if (typeof resolved.cacheMaxAge === 'number') {

0 commit comments

Comments
 (0)