be sure that the provided server url ends with / for future concat

Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
This commit is contained in:
Alarig Le Lay 2024-07-28 09:58:35 +02:00
parent f77ab3348c
commit cab6e738aa
Signed by: alarig
GPG key ID: 7AFE62C6DF8BCDEC

View file

@ -255,8 +255,13 @@ def main():
)
domain = pyunycode.convert(args.domain)
# be sure that the provided server url ends with / for future concat
if (isinstance(args.server, str) and args.server[-1] != '/'):
server = args.server + '/'
else:
server = args.server
check = nagiosplugin.Check(
Expiration(domain, args.server),
Expiration(domain, server),
nagiosplugin.ScalarContext(
'daystoexpiration',
warning=wrange,