mirror of
https://github.com/thelounge/thelounge
synced 2024-11-21 19:43:07 +00:00
server: fix loading themes from scoped packages
Scoped packages have slashes in them, that led to them being loaded at the wrong path. Encoding the name fixes this.
This commit is contained in:
parent
0a4adc4592
commit
ac485c483b
2 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ function makePackageThemeObject(
|
|||
return {
|
||||
displayName: module.name || moduleName,
|
||||
filename: path.join(modulePath, module.css),
|
||||
name: moduleName,
|
||||
name: encodeURIComponent(moduleName),
|
||||
themeColor: themeColor,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue