From 7319a6fcb7a901fb5c9afeecc1b25b6095160235 Mon Sep 17 00:00:00 2001 From: Lucilio Correia Date: Tue, 22 Oct 2024 13:57:00 -0300 Subject: [PATCH] fix: stop parsing if URL does not have a schema --- scripts/dburl-parser.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/dburl-parser.sh b/scripts/dburl-parser.sh index a9c6ed3..6c46a81 100755 --- a/scripts/dburl-parser.sh +++ b/scripts/dburl-parser.sh @@ -14,6 +14,10 @@ queryless_url="${DB_URL%%\?*}"; # get URL's schema schema="${queryless_url%//*}"; +if test "${schema}" = "${queryless_url}"; then + echo >&2 "database URLs must start with schema (i.e.: mysql://)"\ + && exit 2; +fi schemaless_url=${queryless_url#*//}; # left hand is everything until the first @ (the user part)