Python bridge now works and serves files correctly. Only necessary folders are accessible from the browser.

This commit is contained in:
Raphaël Numbus
2026-05-17 14:43:35 +02:00
parent 7a6202c014
commit ff450a5770
4 changed files with 15 additions and 9 deletions
+6
View File
@@ -31,6 +31,12 @@ class BridgeHandler(http.server.SimpleHTTPRequestHandler):
# Read last 50 lines for better context during errors
self.wfile.write("".join(f.readlines()[-50:]).encode())
return
# Restrict static file access to specific directories only
if not any(self.path.startswith(prefix) for prefix in ['/pages', '/media']):
self.send_error(403, "Access Denied: Resource is restricted.")
return
return http.server.SimpleHTTPRequestHandler.do_GET(self)
def do_POST(self):