diff --git a/server/plugins/packages/themes.ts b/server/plugins/packages/themes.ts index 0594786f..67006a4f 100644 --- a/server/plugins/packages/themes.ts +++ b/server/plugins/packages/themes.ts @@ -85,7 +85,7 @@ function makePackageThemeObject( return { displayName: module.name || moduleName, filename: path.join(modulePath, module.css), - name: moduleName, + name: encodeURIComponent(moduleName), themeColor: themeColor, }; } diff --git a/server/server.ts b/server/server.ts index ab8d2419..29f696d3 100644 --- a/server/server.ts +++ b/server/server.ts @@ -107,7 +107,7 @@ export default async function ( // handler. Remember this if you make changes to this function, serving of // local themes will not get those changes. app.get("/themes/:theme.css", (req, res) => { - const themeName = req.params.theme; + const themeName = encodeURIComponent(req.params.theme); const theme = themes.getByName(themeName); if (theme === undefined || theme.filename === undefined) {