Error in generating extension for `video/mp4` content type for ActiveStorage image delivery url
Problem
When using with Rails ActiveStorage, the extension generated for a content_type of video/mp4 is mp4v, while it is saved in cloudinary with the extension of mp4 in the url. As a result, image delivery with Active Storage is broken.
Extension generated should be mp4.
Hi @lilei-c5. Thanks for reporting this. This is due to https://github.com/cloudinary/cloudinary_gem/blob/master/lib/active_storage/service/cloudinary_service.rb#L154 where it swaps the keys/values and because the extensions are unique but the content_type not when they are inverted it takes the last value for extension (.mp4v in this case) and that is set as the values for the video/mp4 content type key. I'll create a ticket on our side to resolve this.
@lilei-c5 Just wanted to update you that our team have rolled out a fix for this. May I please ask you to update the gem to version 1.13.2 and try that again?