server id validation

pull/22091/head
JzoNg 11 months ago
parent 14a1bba9b7
commit 061eada8c5

@ -73,6 +73,10 @@ const MCPModal = ({
}
}
const isValidServerID = (str: string) => {
return /^[a-z0-9_-]{1,24}$/.test(str)
}
const handleBlur = async (url: string) => {
if (data)
return
@ -99,7 +103,7 @@ const MCPModal = ({
Toast.notify({ type: 'error', message: 'invalid server url' })
return
}
if (!serverIdentifier.trim()) {
if (!isValidServerID(serverIdentifier.trim())) {
Toast.notify({ type: 'error', message: 'invalid server identifier' })
return
}

Loading…
Cancel
Save