Skip to content

Commit

Permalink
Fix windows metadata slashes (#51088)
Browse files Browse the repository at this point in the history
Fixes #51086

The path is used as href, should be normalized as posix style
fix NEXT-1282
  • Loading branch information
huozhi committed Jun 10, 2023
1 parent d8763ca commit cfd64aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/next/src/lib/metadata/get-metadata-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { interpolateDynamicPath } from '../../server/server-utils'
import { getNamedRouteRegex } from '../../shared/lib/router/utils/route-regex'
import { djb2Hash } from '../../shared/lib/hash'
import { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'
import { normalizePathSep } from '../../shared/lib/page-path/normalize-path-sep'

/*
* If there's special convention like (...) or @ in the page path,
Expand Down Expand Up @@ -42,7 +43,7 @@ export function fillMetadataSegment(

const { name, ext } = path.parse(imageSegment)

return path.join(route, `${name}${routeSuffix}${ext}`)
return normalizePathSep(path.join(route, `${name}${routeSuffix}${ext}`))
}

/**
Expand Down

0 comments on commit cfd64aa

Please sign in to comment.