#How to configure CSP for MP4 video file served under public/videos directory

1 messages · Page 1 of 1 (latest)

stray iron
#

As the title suggest I have been struggling for the past 2 days on this CSP error.

I have an MP4 file under public/videos/file.mp4 and use it in NextJS app.

It is properly showing locally but when served in Vercel on preview the CSP error kicks in.

I already have this on my configuration media-src 'self' blob: data: /videos/; is it possible?

gritty eagleBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

cerulean lion
#

How big is your mp4 file?

#

Also you should be very careful when serving large files, such as videos, directly from next.js public folder on serverless platforms such as Vercel!

stray iron
#

It's around 5MB in size, what's the reason why I should not use the public folder?