mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-08 22:50:00 +08:00
fixed some backend errors, added more logs
This commit is contained in:
parent
a98d763e56
commit
8047f38076
1 changed files with 9 additions and 3 deletions
|
@ -430,7 +430,7 @@ exports.updateResultTags = functions.https.onCall((request,response) => {
|
|||
|
||||
function isConfigKeyValid(name){
|
||||
if(name === null || name === undefined || name === "") return false;
|
||||
if(name.length > 20) return false;
|
||||
if(name.length > 30) return false;
|
||||
return /^[0-9a-zA-Z_.\-\#]+$/.test(name);
|
||||
}
|
||||
|
||||
|
@ -448,10 +448,16 @@ exports.saveConfig = functions.https.onCall((request,response) => {
|
|||
let val = obj[key];
|
||||
if(Array.isArray(val)){
|
||||
val.forEach(valarr => {
|
||||
if(!isConfigKeyValid(valarr)) err = true;
|
||||
if(!isConfigKeyValid(valarr)){
|
||||
err = true;
|
||||
console.error(`${key}: ${valarr} failed regex check`);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
if(!isConfigKeyValid(val)) err = true;
|
||||
if(!isConfigKeyValid(val)){
|
||||
err = true;
|
||||
console.error(`${key}: ${val} failed regex check`);
|
||||
}
|
||||
}
|
||||
})
|
||||
if (err){
|
||||
|
|
Loading…
Add table
Reference in a new issue