Skip to content

Commit

Permalink
Fixed mongo-test database parsing to allow for not providing ://
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsvedin committed Sep 26, 2023
1 parent ed78ba3 commit 376e5fd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class MongoDatabase(val databaseName: String, private val makeClient: () -> Mong
?: throw IllegalStateException("Invalid mongodb URL. The URL should match the pattern: mongodb+srv://[credentials and host information]/[databaseName]?[params]")
}
DatabaseSettings.register("mongodb-test") {
Regex("""mongodb-test://(?:\?(?<params>.*))?""")
Regex("""mongodb-test(?:://\?(?<params>.*))?""")
.matchEntire(it.url)
?.let { match ->
val params: Map<String, List<String>>? = match.groups["params"]?.value?.let { params ->
Expand Down

0 comments on commit 376e5fd

Please sign in to comment.