Skip to content

Commit

Permalink
fix adding localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyrAhmady committed Nov 12, 2023
1 parent 2909fb3 commit cbda330
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ export const validateServerAddress = (address: string) => {
) {
return true;
} else {
// Check if it's localhost
if (address === "localhost") {
return true;
}

// Check if it's a valid domain
let regex = new RegExp(
/^(?!-)[A-Za-z0-9-]+([\-\.]{1}[a-z0-9]+)*\.[A-Za-z]{2,6}$/
Expand Down

0 comments on commit cbda330

Please sign in to comment.