File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,9 @@ export async function handler(
225
225
const method = req . method || 'GET'
226
226
227
227
const resolvedUrl = formatUrl ( {
228
- pathname : parsedUrl . pathname ,
228
+ pathname : nextConfig . trailingSlash
229
+ ? parsedUrl . pathname
230
+ : removeTrailingSlash ( parsedUrl . pathname || '/' ) ,
229
231
// make sure to only add query values from original URL
230
232
query : hasStaticProps ? { } : originalQuery ,
231
233
} )
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ import {
59
59
type RouterServerContext ,
60
60
} from '../lib/router-utils/router-server-context'
61
61
import { decodePathParams } from '../lib/router-utils/decode-path-params'
62
+ import { removeTrailingSlash } from '../../shared/lib/router/utils/remove-trailing-slash'
62
63
63
64
/**
64
65
* RouteModuleOptions is the options that are passed to the route module, other
@@ -782,6 +783,8 @@ export abstract class RouteModule<
782
783
resolvedPathname = decodePathParams ( resolvedPathname )
783
784
} catch ( _ ) { }
784
785
786
+ resolvedPathname = removeTrailingSlash ( resolvedPathname )
787
+
785
788
return {
786
789
query,
787
790
originalQuery,
You can’t perform that action at this time.
0 commit comments