From 2e905e965caefbdce2213c05b35d2bcd88ab3c4b Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Wed, 15 Jan 2020 17:19:14 +0100 Subject: [PATCH] Relax host checking for FastHttpLocust to be more in line with HttpLocust. Fixes #1222 --- locust/contrib/fasthttp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locust/contrib/fasthttp.py b/locust/contrib/fasthttp.py index b818390069..c137856779 100644 --- a/locust/contrib/fasthttp.py +++ b/locust/contrib/fasthttp.py @@ -76,8 +76,8 @@ def __init__(self): super(FastHttpLocust, self).__init__() if self.host is None: raise LocustError("You must specify the base host. Either in the host attribute in the Locust class, or on the command line using the --host option.") - if not re.match(r"^https?://[^/]+$", self.host, re.I): - raise LocustError("Invalid host (`%s`). The specified host string must be a base URL without a trailing slash. E.g. http://example.org" % self.host) + if not re.match(r"^https?://[^/]+", self.host, re.I): + raise LocustError("Invalid host (`%s`), must be a valid base URL. E.g. http://example.com" % self.host) self.client = FastHttpSession(base_url=self.host)