diff --git a/src/octoprint/server/util/tornado.py b/src/octoprint/server/util/tornado.py index 9ce759362..36e1fb454 100644 --- a/src/octoprint/server/util/tornado.py +++ b/src/octoprint/server/util/tornado.py @@ -1097,7 +1097,7 @@ class UrlProxyHandler(RequestlessExceptionLoggingMixin, if not self._basename: return None - typeValue = list(map(str.strip, content_type.split(";"))) + typeValue = list(x.strip() for x in content_type.split(";")) if len(typeValue) == 0: return None diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py index d43fe895f..672132ec6 100644 --- a/src/octoprint/util/__init__.py +++ b/src/octoprint/util/__init__.py @@ -203,7 +203,7 @@ def is_allowed_file(filename, extensions): boolean: True if the file name's extension matches one of the allowed extensions, False otherwise. """ - return "." in filename and filename.rsplit(".", 1)[1].lower() in map(str.lower, extensions) + return "." in filename and filename.rsplit(".", 1)[1].lower() in (x.lower() for x in extensions) def get_formatted_timedelta(d):