From 36507ea8464a3877cb8ebe699bbecd2deb10f727 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 5 Jan 2022 15:11:32 +0000 Subject: [PATCH] Minimal check for url --- session.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/session.py b/session.py index 54ee7200f..0f25c932e 100644 --- a/session.py +++ b/session.py @@ -509,6 +509,13 @@ def download_image_any_mime_type(session, url: str, timeout_sec: int, debug: bool): """http GET for an image with any mime type """ + # check that this looks like a url + if '://' not in url: + if debug: + print('WARN: download_image_any_mime_type, ' + + url + ' does not look like a url') + return None, None + mime_type = None content_type = None result = None