Skip to content

Commit

Permalink
Use slice in router-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Mar 24, 2022
1 parent 38debfa commit 9c2755c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/server/router-utils.ts
Expand Up @@ -3,7 +3,7 @@ export function replaceBasePath(pathname: string, basePath: string): string {
// and doesn't contain extra chars e.g. basePath /docs
// should replace for /docs, /docs/, /docs/a but not /docsss
if (hasBasePath(pathname, basePath)) {
pathname = pathname.substr(basePath.length)
pathname = pathname.slice(basePath.length)
if (!pathname.startsWith('/')) pathname = `/${pathname}`
}
return pathname
Expand Down

0 comments on commit 9c2755c

Please sign in to comment.