Files
RepoDructor/plugins/proxy-headers.client.ts
josedario87 bf7413b45f Fix 403 error when loading music files
- Fix path traversal security check by using absolute paths
- Remove problematic fetch override that forced JSON headers on all API requests
- Add error tracking and visual indicators for failed tracks
- Correct music directory resolution for both relative and absolute paths

The main issue was the security validation comparing relative paths incorrectly,
causing legitimate music file requests to be rejected with 403 errors.
2025-08-10 01:28:16 -06:00

21 lines
779 B
TypeScript

export default defineNuxtPlugin(() => {
// Handle proxy headers and ensure proper request handling
if (process.client) {
// Handle WebSocket connection errors gracefully
const originalConsoleError = console.error
console.error = function(...args) {
// Suppress noisy WebSocket HMR connection errors
if (args[0] && typeof args[0] === 'string' &&
(args[0].includes('WebSocket connection') ||
args[0].includes('failed to connect to websocket'))) {
return // Suppress these specific errors
}
originalConsoleError.apply(console, args)
}
// Handle Nuxt/Vite specific issues with proxy
if ('__NUXT__' in window) {
console.log('[PROXY] Nuxt app loaded through proxy successfully')
}
}
})