mirror of
https://github.com/netbirdio/dashboard.git
synced 2026-01-26 01:21:04 +00:00
Fix http://localhost:3000/ url validation case (#388)
* Fix http://localhost:3000/ url validation case * adjust min regex occurrences
This commit is contained in:
@@ -60,7 +60,7 @@ export const validator = {
|
||||
isValidUrl: (urlString: string) => {
|
||||
const urlPattern = new RegExp(
|
||||
"^(https?:\\/\\/)?" + // validate protocol
|
||||
"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // validate domain name
|
||||
"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|localhost|" + // validate domain name
|
||||
"((\\d{1,3}\\.){3}\\d{1,3}))" + // validate OR ip (v4) address
|
||||
"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // validate port and path
|
||||
"(\\?[;&a-z\\d%_.~+=-]*)?" + // validate query string
|
||||
|
||||
Reference in New Issue
Block a user