Skip to content

Commit f01ebd2

Browse files
committed
Fix mongodb.url config parsing when additional options are passed in.
The database name wasn't properly extracted when there were additional options after the "?" in the connecting URL.
1 parent a3ed7a0 commit f01ebd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api-umbrella/cli/read_config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ local function set_computed_config()
309309
_package_path = package.path,
310310
_package_cpath = package.cpath,
311311
mongodb = {
312-
_database = array_last(plutils.split(config["mongodb"]["url"], "/")),
312+
_database = plutils.split(array_last(plutils.split(config["mongodb"]["url"], "/", true)), "?", true)[1],
313313
},
314314
elasticsearch = {
315315
_first_host = config["elasticsearch"]["hosts"][1],

0 commit comments

Comments
 (0)