fix headers sent error

This commit is contained in:
Aode (lion) 2021-11-10 17:44:41 -05:00
parent 02d616ba97
commit 78b0c46c29

View file

@ -40,7 +40,9 @@ export default class Webserver {
// We register the default route last to make sure we don't override anything by accident.
// We'll pass off all other requests to the web app
this.app.get(/(widgets\/|riot\/|element\/|\/)*/, (_req, res) => {
res.sendFile(path.join(__dirname, "..", "..", "web", "index.html"));
if (!res.headersSent) {
res.sendFile(path.join(__dirname, "..", "..", "web", "index.html"));
}
});
// Set up the error handler