cloudinary_gem icon indicating copy to clipboard operation
cloudinary_gem copied to clipboard

Error in generating extension for `video/mp4` content type for ActiveStorage image delivery url

Open lilei-c5 opened this issue 5 years ago • 2 comments

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.

lilei-c5 avatar Jan 13 '20 23:01 lilei-c5

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.

aleksandar-cloudinary avatar Jan 14 '20 12:01 aleksandar-cloudinary

@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?

aleksandar-cloudinary avatar Jan 19 '20 14:01 aleksandar-cloudinary