mirror of
https://github.com/modrinth/code.git
synced 2026-08-24 16:44:51 +00:00
fix: encode project slugs in canonical URLs (#7208)
This commit is contained in:
@@ -62,7 +62,7 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
||||
const remainder = pathParts.filter((x) => x).join('/')
|
||||
|
||||
// Build the canonical path
|
||||
const canonicalPath = `/${correctType}/${project.slug}${remainder ? `/${remainder}` : ''}`
|
||||
const canonicalPath = `/${correctType}/${encodeURIComponent(project.slug)}${remainder ? `/${remainder}` : ''}`
|
||||
|
||||
// Only redirect if the path actually changed
|
||||
if (to.path !== canonicalPath) {
|
||||
|
||||
Reference in New Issue
Block a user