Skip to content

Commit 208a869

Browse files
authored
Merge pull request quarkusio#50050 from phillip-kruger/dev-ui-datasource-mssql
Dev UI Agroal: Fix jdbc url parsing for url with ; in it
2 parents b404596 + 22c760e commit 208a869

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

extensions/agroal/runtime-dev/src/main/java/io/quarkus/agroal/runtime/dev/ui/DatabaseInspector.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@ private boolean isAllowedDatabase(AgroalDataSource ads) {
458458
return true;
459459
}
460460

461+
if (ads == null)
462+
return false;
463+
461464
try {
462465
AgroalDataSourceConfiguration configuration = ads.getConfiguration();
463466
String jdbcUrl = configuration.connectionPoolConfiguration().connectionFactoryConfiguration().jdbcUrl();
@@ -469,7 +472,7 @@ private boolean isAllowedDatabase(AgroalDataSource ads) {
469472
return true;
470473
}
471474

472-
String cleanUrl = jdbcUrl.replace("jdbc:", "");
475+
String cleanUrl = jdbcUrl.replace("jdbc:", "").replaceFirst(";", "?").replace(";", "&");
473476
URI uri = new URI(cleanUrl);
474477

475478
String host = uri.getHost();

0 commit comments

Comments
 (0)