Moved Regex for baseUrl to Globalbase

This commit is contained in:
2023-09-20 13:30:52 +02:00
parent 660f6a1648
commit 7a14583d6a
3 changed files with 7 additions and 4 deletions

View File

@ -22,10 +22,9 @@ public abstract class LibraryConnector : GlobalBase
protected LibraryConnector(GlobalBase clone, string baseUrl, string auth, LibraryType libraryType) : base(clone)
{
Log($"Creating libraryConnector {Enum.GetName(libraryType)}");
Regex urlRex = new(@"https?:\/\/[0-9A-z\.]*");
if (!urlRex.IsMatch(baseUrl))
if (!baseUrlRex.IsMatch(baseUrl))
throw new ArgumentException("Base url does not match pattern");
this.baseUrl = urlRex.Match(baseUrl).Value;
this.baseUrl = baseUrlRex.Match(baseUrl).Value;
this.auth = auth;
this.libraryType = libraryType;
}