0

Using the regular cl_image_tag(carrierwave_object) will always produce an http://cloudinary-url URL, which fails to load on most browsers if they connected to the website through https. Is it possible to make cloudinary serve URLs such as //cloudinary-url so that the browser can choose the protocol itself, without finding every single cl_image_tag call and changing it manually?

Note that I'm using the cloudinary_rb gem with Rails 3.2.x

Thanks!

Emil Ahlbäck
  • 6,085
  • 8
  • 39
  • 54
  • Is it? I must have missed the configuration variable to do that, will see if I can find it! – Emil Ahlbäck Feb 27 '14 at 13:22
  • @Bartdude that configuration options was right there at http://cloudinary.com/documentation/rails_additional_topics#configuration_options - write an answer out of your comment (include the links as well for further folks) and I'll mark it :) – Emil Ahlbäck Feb 27 '14 at 13:26

2 Answers2

2

You can use cloudinary over https

That wouldn't be a problem for non-https users of your site cause there's no security warning in that direction...

Laurent S.
  • 6,816
  • 2
  • 28
  • 40
  • Sigh, another caveat: HTTPs delivery for subdomains does not work. We'll have to go with the HTTP URLs for now since not using CDN subdomains is out of the question. It doesn't prevent images from loading however. – Emil Ahlbäck Feb 27 '14 at 13:38
0

You could create a helper that would take a url and generate an http or https url depending on what case you are. You can always know in your views / helpers if you are on http or https from your request object.

xlembouras
  • 8,215
  • 4
  • 33
  • 42
  • True, that however means I need to stop using the provided helpers that cloudinary_rb provides. – Emil Ahlbäck Feb 27 '14 at 13:30
  • well external gems are to be used as long as they help :-) If `cloudinary` solves more problems than the protocol agnostic url than you should keep using it. – xlembouras Feb 27 '14 at 13:33