diff --git a/workers/open-graph/index.js b/workers/open-graph/index.js index 766aa0b86..b27a3712b 100644 --- a/workers/open-graph/index.js +++ b/workers/open-graph/index.js @@ -38,7 +38,16 @@ function ensureInit() { } function parseRoute(pathname) { - const segments = pathname.replace(/^\//, "").split("/"); + const segments = pathname + .replace(/^\//, "") + .split("/") + .map(s => { + try { + return decodeURIComponent(s); + } catch { + return s; + } + }); const first = segments[0]; if (first === "" || first === undefined) return { type: "home" };