Skip to content

Commit

Permalink
Exit early if invalid web base path
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbaldwin44 committed Nov 4, 2024
1 parent d7d500f commit 3b27b8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,11 @@ def ensure_user_class_name(config):
if not options.headless and not options.worker:
protocol = "https" if options.tls_cert and options.tls_key else "http"

if options.web_base_path[0] != "/":
logger.error(
f"Invalid format for --web-base-path argument ({options.web_base_path}): the url path must start with a slash."
)
sys.exit(1)
if options.web_host == "*":
# special check for "*" so that we're consistent with --master-bind-host
web_host = ""
Expand Down

0 comments on commit 3b27b8c

Please sign in to comment.