The issue is due to os.path.join semantics:
If a component is an absolute path, all previous components are thrown away
and joining continues from the absolute path component.
self.wfile.write(response.encode('UTF-8', 'replace'))
elif self.symcov_data.has_file(self.path[1:]):
filename = self.path[1:]
- filepath = os.path.join(self.src_path, filename)
+ filepath = os.path.join(self.src_path, filename.lstrip('/'))
if not os.path.exists(filepath):
self.send_response(404)
self.end_headers()