mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 04:51:16 +08:00
security patch from live
This commit is contained in:
parent
c4fdeb53ae
commit
6ff2984ef7
1 changed files with 10 additions and 2 deletions
|
@ -80,8 +80,16 @@ function validateConfig(config) {
|
|||
if (!isConfigKeyValid(key)) {
|
||||
throw new MonkeyError(500, `Invalid config: ${key} failed regex check`);
|
||||
}
|
||||
if (key === "resultFilters") return;
|
||||
if (key === "customBackground") return;
|
||||
// if (key === "resultFilters") return;
|
||||
// if (key === "customBackground") return;
|
||||
if (key === "customBackground" || key === "customLayoutfluid") {
|
||||
if (/[<>]/.test(config[key])) {
|
||||
throw new MonkeyError(
|
||||
500,
|
||||
`Invalid config: ${key}:${config.key} failed regex check`
|
||||
);
|
||||
}
|
||||
}
|
||||
let val = config[key];
|
||||
if (Array.isArray(val)) {
|
||||
val.forEach((valarr) => {
|
||||
|
|
Loading…
Reference in a new issue