Fix recent requests loading on startup

This commit is contained in:
Gregory Schier
2023-10-28 18:27:18 -07:00
parent c4a8603b81
commit 6202e59daa
4 changed files with 16 additions and 14 deletions

View File

@@ -63,7 +63,7 @@ const validateHttpHeader = (v: string) => {
return true;
}
const hi = v.replace(/\$\{\[\s*[^\]\s]+\s*]}/gi, 'fo');
console.log('V', v, '-->', hi);
return v.match(/^[a-zA-Z0-9-_]+$/) !== null;
// Template strings are not allowed so we replace them with a valid example string
const withoutTemplateStrings = v.replace(/\$\{\[\s*[^\]\s]+\s*]}/gi, '123');
return withoutTemplateStrings.match(/^[a-zA-Z0-9-_]+$/) !== null;
};