diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-09-13 13:04:36 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-09-13 13:04:36 -0400 |
commit | 9d7be6fb9103cf7dd5418e79782a187b9c2d7cf0 (patch) | |
tree | 8b28cbad592528ad1a48d868b8084afdac148681 | |
parent | bbe6187a90b643fd6e9d70fccdbf392b27ee0f4a (diff) | |
download | b4-9d7be6fb9103cf7dd5418e79782a187b9c2d7cf0.tar.gz |
Improve the web endpoint validity check
Check that it actually starts with https://.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/__init__.py | 2 | ||||
-rw-r--r-- | b4/ez.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/b4/__init__.py b/b4/__init__.py index d734680..8a358f0 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -3149,7 +3149,7 @@ def send_mail(smtp: Union[smtplib.SMTP, smtplib.SMTP_SSL, None], msgs: Sequence[ # Do we have an endpoint defined? config = get_main_config() endpoint = config.get('send-endpoint-web', '') - if not re.search(r'https?://', endpoint): + if not re.search(r'^https?://', endpoint): endpoint = None if use_web_endpoint and endpoint: logger.info('Sending via web endpoint %s', endpoint) @@ -74,7 +74,7 @@ Changes in v${newrev}: def get_auth_configs() -> Tuple[str, str, str, str, str, str]: config = b4.get_main_config() endpoint = config.get('send-endpoint-web', '') - if not re.search(r'https?://', endpoint): + if not re.search(r'^https?://', endpoint): endpoint = None if not endpoint: @@ -1235,7 +1235,7 @@ def cmd_send(cmdargs: argparse.Namespace) -> None: send_msgs.append(msg) endpoint = config.get('send-endpoint-web', '') - if not re.search(r'https?://', endpoint): + if not re.search(r'^https?://', endpoint): endpoint = None if endpoint: |