fix: add game-assets, maptiles, mapcache static mounts + frame-src CSP
Without /game-assets mount the game iframes loaded 404. Without /maptiles mount the map tiles didn't render. frame-src 'self' CSP directive needed for iframe sandboxing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5717204716
commit
bb2d7acfd9
1 changed files with 14 additions and 1 deletions
|
|
@ -50,7 +50,19 @@ module.exports = ({ host, port, middleware, allowHost }) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(mount("/assets", assets));
|
app.use(mount("/assets", assets));
|
||||||
|
|
||||||
|
const maptiles = new Koa();
|
||||||
|
maptiles.use(koaStatic(join(__dirname, "..", "maps", "tiles")));
|
||||||
|
app.use(mount("/maptiles", maptiles));
|
||||||
|
|
||||||
|
const mapcache = new Koa();
|
||||||
|
mapcache.use(koaStatic(join(__dirname, "..", "maps", "cache")));
|
||||||
|
app.use(mount("/mapcache", mapcache));
|
||||||
|
|
||||||
|
const gamesStatic = new Koa();
|
||||||
|
gamesStatic.use(koaStatic(join(__dirname, "..", "games")));
|
||||||
|
app.use(mount("/game-assets", gamesStatic));
|
||||||
|
|
||||||
// pdf viewer
|
// pdf viewer
|
||||||
app.use(mount("/js", koaStatic(path.join(__dirname, 'public/js'))));
|
app.use(mount("/js", koaStatic(path.join(__dirname, 'public/js'))));
|
||||||
app.use(koaStatic(path.join(__dirname, 'public')));
|
app.use(koaStatic(path.join(__dirname, 'public')));
|
||||||
|
|
@ -66,6 +78,7 @@ module.exports = ({ host, port, middleware, allowHost }) => {
|
||||||
"img-src 'self'",
|
"img-src 'self'",
|
||||||
"media-src 'self' blob:",
|
"media-src 'self' blob:",
|
||||||
"worker-src 'self' blob:",
|
"worker-src 'self' blob:",
|
||||||
|
"frame-src 'self'",
|
||||||
"form-action 'self'",
|
"form-action 'self'",
|
||||||
"object-src 'none'",
|
"object-src 'none'",
|
||||||
"base-uri 'none'",
|
"base-uri 'none'",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue