diff --git a/app/controllers/social_previews_controller.rb b/app/controllers/social_previews_controller.rb index 019eb6868..93ddcdd1b 100644 --- a/app/controllers/social_previews_controller.rb +++ b/app/controllers/social_previews_controller.rb @@ -61,8 +61,9 @@ class SocialPreviewsController < ApplicationController end format.png do html = render_to_string(template, formats: :html, layout: false) - redirect_to HtmlCssToImage.fetch_url(html: html, css: PNG_CSS, - google_fonts: I18n.t("social_previews_controller.fonts")), status: :found + url = HtmlCssToImage.fetch_url(html: html, css: PNG_CSS, + google_fonts: I18n.t("social_previews_controller.fonts")) + redirect_to url, allow_other_host: true, status: :found end end end diff --git a/config/initializers/new_framework_defaults_7_0.rb b/config/initializers/new_framework_defaults_7_0.rb index 2df967e2a..7a425626d 100644 --- a/config/initializers/new_framework_defaults_7_0.rb +++ b/config/initializers/new_framework_defaults_7_0.rb @@ -50,7 +50,7 @@ Rails.application.config.active_support.executor_around_test_case = true # Define the isolation level of most of Rails internal state. # If you use a fiber based server or job processor, you should set it to `:fiber`. # Otherwise the default of `:thread` if preferable. -# Rails.application.config.active_support.isolation_level = :thread +Rails.application.config.active_support.isolation_level = :thread # Set both the `:open_timeout` and `:read_timeout` values for `:smtp` delivery method. Rails.application.config.action_mailer.smtp_timeout = 5 @@ -64,10 +64,10 @@ Rails.application.config.active_record.verify_foreign_keys_for_fixtures = true # Disable partial inserts. # This default means that all columns will be referenced in INSERT queries # regardless of whether they have a default or not. -# Rails.application.config.active_record.partial_inserts = false +Rails.application.config.active_record.partial_inserts = false # # Protect from open redirect attacks in `redirect_back_or_to` and `redirect_to`. -# Rails.application.config.action_controller.raise_on_open_redirects = true +Rails.application.config.action_controller.raise_on_open_redirects = true # If you're upgrading and haven't set `cookies_serializer` previously, your cookie serializer # was `:marshal`. Convert all cookies to JSON, using the `:hybrid` formatter.