fix: add range request support and proper headers for large MP3 playback
This commit is contained in:
@@ -4,6 +4,32 @@ const nextConfig: NextConfig = {
|
||||
/* config options here */
|
||||
reactCompiler: true,
|
||||
output: 'standalone',
|
||||
experimental: {
|
||||
serverActions: {
|
||||
bodySizeLimit: '50mb',
|
||||
},
|
||||
},
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: '/uploads/:path*.mp3',
|
||||
headers: [
|
||||
{
|
||||
key: 'Content-Type',
|
||||
value: 'audio/mpeg',
|
||||
},
|
||||
{
|
||||
key: 'Accept-Ranges',
|
||||
value: 'bytes',
|
||||
},
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: 'public, max-age=31536000, immutable',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user