From b7cd6c331aba4dcd57ef08413de388cf8ff4a4e5 Mon Sep 17 00:00:00 2001 From: Boyan Date: Sun, 8 Dec 2024 00:23:17 +0100 Subject: [PATCH] Updated the app to handle cooler urls --- src/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.py b/src/app.py index f5c2429..8a26824 100644 --- a/src/app.py +++ b/src/app.py @@ -84,7 +84,8 @@ def verify_link(link:str) -> bool: if not link.startswith('http://') and not link.startswith('https://'): link = 'http://' + link reg = r'^(https?:\/\/)(([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(:\d+)?(\/[a-zA-Z0-9@:%_\+.~#?&//=]*)?$' - return False if not re.match(reg, link) else True + + return bool(re.match(reg, link)) @app.route('/form', methods=['GET', 'POST']) def form():