diff options
author | 2021-03-26 13:37:21 +0100 | |
---|---|---|
committer | 2021-03-26 13:37:21 +0100 | |
commit | bc25bfdf42cdaaba924a7ad6de1dc06a9b381285 (patch) | |
tree | f213e919256000f1d74be9c4e6ad1216a70a10fb | |
parent | Merge remote-tracking branch 'upstream/main' into doc-imp (diff) |
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
-rw-r--r-- | bot/exts/info/doc/_cog.py | 2 |
1 files changed, 2 insertions, 0 deletions
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, |