Fix valid check of mcp server address (#22510)
This commit is contained in:
parent
d0bece1679
commit
0e235e5872
1 changed files with 1 additions and 1 deletions
|
|
@ -70,7 +70,7 @@ const MCPModal = ({
|
||||||
|
|
||||||
const isValidUrl = (string: string) => {
|
const isValidUrl = (string: string) => {
|
||||||
try {
|
try {
|
||||||
const urlPattern = /^(https?:\/\/)((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?/i
|
const urlPattern = /^(https?:\/\/)((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3})|localhost)(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?/i
|
||||||
return urlPattern.test(string)
|
return urlPattern.test(string)
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue