fix(preview): add missing font MIME types to web server

- Added MIME type mappings for .otf, .woff, and .woff2 font formats
- Fixed missing break statement after .wav case (was falling through to .mp4)
- Fonts now load correctly in editor preview without 404 errors
- Resolves OTS parsing error messages in console

The web server was already serving project directory files correctly,
but browsers were rejecting font files due to missing/incorrect MIME types.

Related to TASK-006
This commit is contained in:
Richard Osborne
2025-12-15 22:57:48 +01:00
parent 0b47d19776
commit ea45e8b3a3
22 changed files with 5510 additions and 364 deletions

View File

@@ -302,7 +302,7 @@ function getContentType(request) {
break;
case '.wav':
contentType = 'audio/wav';
// eslint-disable-next-line no-fallthrough
break;
case '.mp4':
case '.m4v':
contentType = 'video/mp4';
@@ -316,6 +316,15 @@ function getContentType(request) {
case '.ttf':
contentType = 'font/ttf';
break;
case '.otf':
contentType = 'font/otf';
break;
case '.woff':
contentType = 'font/woff';
break;
case '.woff2':
contentType = 'font/woff2';
break;
}
return contentType;