match whole string

This commit is contained in:
Pilzinsel64
2024-12-18 10:41:57 +01:00
parent 3fa4d18f77
commit 69e0900f7d

View File

@@ -101,7 +101,10 @@ public class ApiServer(string apiUrl) : IApiServer
} }
} }
if (useRegEx) if (useRegEx)
{
url = url.Replace(".", "\\."); // Escape special characters url = url.Replace(".", "\\."); // Escape special characters
url = $"^{url}$"; // Define start and end of line (matches whole string)
}
// Add handler // Add handler
Log.InfoFormat("Added handler for {0}", attribute.Route); Log.InfoFormat("Added handler for {0}", attribute.Route);