Skip to content

Commit

Permalink
Fix minimal basePath handling (#53174)
Browse files Browse the repository at this point in the history
We no longer handle basePath stripping further down in minimal mode so
this prevents the re-adding we used to do.

Manually tested with
https://33-base-path-gsp-404-m8w6hhs1m-vtest314-ijjk-testing.vercel.app/docs/api/hello

Fixes: [slack
thread](https://vercel.slack.com/archives/C03F2CMNGKG/p1690309135573409)
  • Loading branch information
ijjk authored and kwonoj committed Jul 26, 2023
1 parent d2e0411 commit 935e447
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/next/src/server/base-server.ts
Expand Up @@ -930,9 +930,7 @@ export default abstract class Server<ServerOptions extends Options = Options> {
for (const key of routeParamKeys) {
delete parsedUrl.query[key]
}
parsedUrl.pathname = `${this.nextConfig.basePath || ''}${
matchedPath === '/' && this.nextConfig.basePath ? '' : matchedPath
}`
parsedUrl.pathname = matchedPath
url.pathname = parsedUrl.pathname
} catch (err) {
if (err instanceof DecodeError || err instanceof NormalizeError) {
Expand Down

0 comments on commit 935e447

Please sign in to comment.