From 3eba254b28bdcf1f829b21535a5e9d087f6d32d2 Mon Sep 17 00:00:00 2001 From: alexradzin Date: Wed, 15 Nov 2023 19:19:06 +0200 Subject: [PATCH] fixed pattern that discovers DB name --- .../firebolt/jdbc/connection/settings/FireboltProperties.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/firebolt/jdbc/connection/settings/FireboltProperties.java b/src/main/java/com/firebolt/jdbc/connection/settings/FireboltProperties.java index 76027b63d..826c1dd32 100644 --- a/src/main/java/com/firebolt/jdbc/connection/settings/FireboltProperties.java +++ b/src/main/java/com/firebolt/jdbc/connection/settings/FireboltProperties.java @@ -21,7 +21,7 @@ @CustomLog public class FireboltProperties { - private static final Pattern DB_PATH_PATTERN = Pattern.compile("([a-zA-Z0-9_*\\-]+)"); + private static final Pattern DB_PATH_PATTERN = Pattern.compile("/?([a-zA-Z0-9_*\\-]+)"); private static final int FIREBOLT_SSL_PROXY_PORT = 443; private static final int FIREBOLT_NO_SSL_PROXY_PORT = 9090; @@ -176,7 +176,7 @@ private static String getDatabase(Properties properties, String path) throws Ill return null; } else { Matcher m = DB_PATH_PATTERN.matcher(path); - if (m.find()) { + if (m.matches()) { return m.group(1); } else { throw new IllegalArgumentException(format("The database provided is invalid %s", path));