0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Cloudinaryを使用し画像をアップロードした際に出てきた⚠️

Posted at

Image from Gyazo
Image from Gyazo
この警告は「混合コンテンツ」と呼ばれるもので、HTTPSページがHTTPリソースを読み込んでいることを示しているそうです。ブラウザはこのような状況でセキュリティの観点から警告を発していました。

原因

cloudinaryからの画像がHTTPでリクエストされていることが問題でした。

cloudinary.yml
---
development:
  cloud_name: <%= ENV['CLOUDINARY_CLOUD_NAME'] %>
  api_key: <%= ENV["CLOUDINARY_API_KEY"] %>
  api_secret: <%= ENV["CLOUDINARY_API_SECRET"] %>
  enhance_image_tag: true
  static_file_support: false
production:
  cloud_name: <%= ENV['CLOUDINARY_CLOUD_NAME'] %>
  api_key: <%= ENV["CLOUDINARY_API_KEY"] %>
  api_secret: <%= ENV["CLOUDINARY_API_SECRET"] %>
  enhance_image_tag: true
  static_file_support: true
  secure: true     #ここを追加
test:
  cloud_name: <%= ENV['CLOUDINARY_CLOUD_NAME'] %>
  api_key: '<%= ENV["CLOUDINARY_API_KEY"] %>'
  api_secret: <%= ENV["CLOUDINARY_API_SECRET"] %>
  enhance_image_tag: true
  static_file_support: false

これで⚠️は出なくなりました!

参考

Image from Gyazo
↑↑↑
https://cloudinary.com/documentation/ruby_rails_quickstart

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?