fix: support f_auto extensionless raw URLs#1048
Merged
Merged
Conversation
✅ Deploy Preview for cld-video-player ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for cld-vp-esm-pages ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
danieldanieli
approved these changes
May 13, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Raw URLs without a file extension (e.g. Cloudinary
f_autodelivery URLs likehttps://res.cloudinary.com/.../cld-sample-video) could not be played becausegenerateRawSourcewas falling back tourl.split('.').pop(), which returns a bogus "extension" (the full last URL path segment), producing an invalid MIME type likevideo/com/.../cld-sample-video.The fix routes extensionless raw URLs through the existing
video/automiddleware, which issues a HEAD request to resolve the realContent-Typefrom the server.Changes
generateRawSourcenow checks the URL's last segment againstCOMMON_VIDEO_EXTENSIONS.mp4,.m3u8) - used directly as before'auto'-video/autoMIME type, triggering the HEAD middlewaresourceTypes(non-auto) are still respected and passed through unchangedCOMMON_VIDEO_EXTENSIONSexported fromvideo-source.const.jsto enable the checkgenerateSourcessimplified: no longer converts'auto'tonullbefore passing togenerateRawSourceHow to Test
Load the player with an extensionless
f_autoCloudinary URL:Expected: video plays normally (middleware resolves
video/mp4via HEAD request).Also verify a raw URL with a known extension still works:
Expected: plays as
video/mp4directly, no HEAD request needed.