Skip to content

PS2 games in the browser: static recompilation to WebAssembly with a native runtime

C++

serve.py: serve files under subdirectories

Riccardo Giorato39a3ea7f0d35
diff --git a/scripts/serve.py b/scripts/serve.py
index b4900dc..1832b63 100755
--- a/scripts/serve.py
+++ b/scripts/serve.py
@@ -33,8 +33,10 @@ class Handler(http.server.BaseHTTPRequestHandler):
path = '/ps2web.html'
if path == '/disc.iso':
return DISC
+ if path.endswith('/'):
+ path += 'index.html'
name = os.path.normpath(path.lstrip('/'))
- if name.startswith('..') or os.sep in name:
+ if name.startswith('..') or name == '.':
return None
full = os.path.join(BUILD, name)
return full if os.path.isfile(full) else None