From 81b7478a68a900820ae7d156901a4f8bcc63349e Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sat, 5 Jul 2025 20:02:39 +0200 Subject: [PATCH] =?UTF-8?q?F=C3=BCge=20benutzerdefinierte=20Handler-Method?= =?UTF-8?q?e=20hinzu,=20um=20das=20Directory-Listing=20zu=20deaktivieren?= =?UTF-8?q?=20und=20403=20Forbidden=20zur=C3=BCckzugeben.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- local_podcast_generator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/local_podcast_generator.py b/local_podcast_generator.py index 25ad42f..fc7796e 100644 --- a/local_podcast_generator.py +++ b/local_podcast_generator.py @@ -267,6 +267,11 @@ Ich spezialisiere mich auf House Music, die mehr als nur Beats bietet – sie er print(f"⚠️ httpdocs-Verzeichnis nicht gefunden: {httpdocs_path}") class CustomHandler(http.server.SimpleHTTPRequestHandler): + def list_directory(self, path): + """Deaktiviert Directory-Listing - zeigt 403 Forbidden.""" + self.send_error(403, "Directory listing disabled") + return None + def end_headers(self): # CORS-Header hinzufügen für bessere Kompatibilität self.send_header('Access-Control-Allow-Origin', '*')