From 309a7c60d6df86f94bf842d93224cabfca0e5fa0 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 7 Sep 2024 21:54:23 +0700 Subject: [PATCH] avoid 'Directory listing forbidden' error --- xpra/net/http/http_handler.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xpra/net/http/http_handler.py b/xpra/net/http/http_handler.py index 4d81a598ff..26b5ed4da0 100644 --- a/xpra/net/http/http_handler.py +++ b/xpra/net/http/http_handler.py @@ -398,15 +398,15 @@ def send_head(self): if os.path.exists(index): path = index break - else: + if os.path.isdir(path): if not self.directory_listing: self.send_error(403, "Directory listing forbidden") return None - code, headers, body = list_directory(path) - self.send_response(code) - self.extra_headers.update(headers) - self.end_headers() - return body + code, headers, body = list_directory(path) + self.send_response(code) + self.extra_headers.update(headers) + self.end_headers() + return body try: code, extra_headers, content = load_path(self.headers, path) lm = extra_headers.get("Last-Modified")