From 0188745d05549ce5776843734968973a9166c11b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 27 Jul 2020 12:08:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20500=20on=20/api/files/loca?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3655 --- src/octoprint/server/api/files.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/octoprint/server/api/files.py b/src/octoprint/server/api/files.py index 26b52627b..abec775a0 100644 --- a/src/octoprint/server/api/files.py +++ b/src/octoprint/server/api/files.py @@ -63,7 +63,12 @@ def _create_lastmodified(path, recursive): return max(lms) else: - storage, path_in_storage = path.split("/", 1) + if "/" in path: + storage, path_in_storage = path.split("/", 1) + else: + storage = path + path_in_storage = None + try: return fileManager.last_modified(storage, path=path_in_storage, recursive=recursive) except Exception: