From 4294f3a9a7ecf1816f2d51c198f48343e7a5980c Mon Sep 17 00:00:00 2001 From: Marcel Hellkamp Date: Mon, 31 Jul 2023 17:04:34 +0200 Subject: [PATCH] Accept server domains with port --- src/components/ConfigModal.vue | 2 +- src/config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ConfigModal.vue b/src/components/ConfigModal.vue index f8c26d3..965ce74 100644 --- a/src/components/ConfigModal.vue +++ b/src/components/ConfigModal.vue @@ -19,7 +19,7 @@ const config = computed({ const formServers = computed({ get: () => config.value.servers.join(" "), - set: (value) => config.value.servers = (value || "").split(" ").filter(isServer), + set: (value) => config.value.servers = (value || "").replace(/https?:\/\//ig, "").split(/[, ]+/).filter(isServer), }); const tagPattern = /#?([\p{Letter}\p{Number}\p{Mark}\p{Connector_Punctuation}_]+)/igu diff --git a/src/config.ts b/src/config.ts index a00e047..609eae7 100644 --- a/src/config.ts +++ b/src/config.ts @@ -210,7 +210,7 @@ export function isAccount(acc: string) { } export function isServer(server: string) { - return isString(server) && server.match(/^([a-z0-9.-]+\.[a-z]{2,})$/i) + return isString(server) && server.match(/^([a-z0-9.-]+\.[a-z]{2,})(:[0-9]{1,5})?$/i) } export function isLanguage(lang: string) {