This commit is contained in:
doomtube 2025-08-09 13:51:36 -04:00
parent 875a53f499
commit d812c6aeab
8 changed files with 2688 additions and 113 deletions

2360
frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -204,15 +204,15 @@
setTimeout(() => message = '', 2000);
}
function formatBitrate(bitrate) {
if (bitrate > 1000000) {
return (bitrate / 1000000).toFixed(2) + ' Mbps';
} else if (bitrate > 1000) {
return (bitrate / 1000).toFixed(0) + ' Kbps';
} else {
return bitrate + ' bps';
}
function formatBitrate(bitrate) {
if (bitrate > 1000000) {
return (bitrate / 1000000).toFixed(2) + ' Mbps';
} else if (bitrate > 1000) {
return Math.round(bitrate / 1000) + ' kbps'; // Changed to lowercase 'kbps' and rounded
} else {
return bitrate + ' bps';
}
}
</script>
<style>

View file

@ -11,7 +11,6 @@ const config = {
precompress: false
}),
// Security improvements
csp: {
mode: 'auto',
directives: {
@ -19,14 +18,20 @@ const config = {
'script-src': ["'self'", "'unsafe-inline'"],
'style-src': ["'self'", "'unsafe-inline'", 'https://cdnjs.cloudflare.com'],
'img-src': ["'self'", 'data:', 'blob:'],
'font-src': ["'self'", 'https://cdnjs.cloudflare.com'],
'connect-src': ["'self'", 'ws://localhost', 'wss://localhost', 'http://localhost:*'],
'font-src': ["'self'", 'data:', 'https://cdnjs.cloudflare.com'], // Added 'data:' for embedded fonts
'connect-src': [
"'self'",
'ws://localhost:*', // Changed to include port wildcard
'wss://localhost:*', // Changed to include port wildcard
'http://localhost:*'
],
'media-src': ["'self'", 'blob:', 'http://localhost:*'],
'object-src': ["'none'"],
'frame-ancestors': ["'none'"],
'form-action': ["'self'"],
'base-uri': ["'self'"]
}
},
// Enable CSRF protection (default is true)