Skip to content

Commit

Permalink
Merge pull request #1227 from locustio/relax-host-checking-for-fastht…
Browse files Browse the repository at this point in the history
…tplocust

Relax host checking for FastHttpLocust to be more in line with HttpLocust. Fixes #1222
  • Loading branch information
cyberw authored Jan 16, 2020
2 parents 815f8fa + 2e905e9 commit c96fcbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions locust/contrib/fasthttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c96fcbc

Please sign in to comment.