From bc25bfdf42cdaaba924a7ad6de1dc06a9b381285 Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Fri, 26 Mar 2021 13:37:21 +0100 Subject: Ensure the base url ends with a slash A base url without a trailing slash won't join properly with the relative paths, raising an error my prevent some mistakes when a new inventory is added --- bot/exts/info/doc/_cog.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py index a06bfcbaf..ff67b0e61 100644 --- a/bot/exts/info/doc/_cog.py +++ b/bot/exts/info/doc/_cog.py @@ -365,6 +365,8 @@ class DocCog(commands.Cog): https://docs.python.org/3/ \ https://docs.python.org/3/objects.inv """ + if not base_url.endswith("/"): + raise commands.BadArgument("The base url must end with a slash.") inventory_url, inventory_dict = inventory body = { "package": package_name, -- cgit v1.2.3