feat: add support for additional mime types and default file type

This commit is contained in:
2025-04-05 07:23:31 -07:00
parent d9cb0edebe
commit 2696fe05d4

View File

@@ -1107,13 +1107,18 @@ const server = http.createServer( ( request, response ) =>
? 'text/plain' ? 'text/plain'
: { : {
'.html' : 'text/html', '.html' : 'text/html',
'.htm' : 'text/html',
'.ico' : 'image/x-icon', '.ico' : 'image/x-icon',
'.jpg' : 'image/jpeg', '.jpg' : 'image/jpeg',
'.png' : 'image/png', '.png' : 'image/png',
'.gif' : 'image/gif', '.gif' : 'image/gif',
'.css' : 'text/css', '.css' : 'text/css',
'.gz' : 'application/gzip', '.gz' : 'application/gzip',
'.js' : 'text/javascript' '.js' : 'text/javascript',
'.txt' : 'text/plain',
'.xml' : 'application/xml',
'.m3u' : 'text/plain',
'.m3u8' : 'text/plain'
}[loadFile.substring( fileExt )]; }[loadFile.substring( fileExt )];
/* /*