aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-09-13 13:04:36 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-09-13 13:04:36 -0400
commit9d7be6fb9103cf7dd5418e79782a187b9c2d7cf0 (patch)
tree8b28cbad592528ad1a48d868b8084afdac148681
parentbbe6187a90b643fd6e9d70fccdbf392b27ee0f4a (diff)
downloadb4-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__.py2
-rw-r--r--b4/ez.py4
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)
diff --git a/b4/ez.py b/b4/ez.py
index d4eb161..dec717e 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -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: