diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 8d5e2fe4f..e8a8f441d 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -11,7 +11,7 @@ class NotificationsController < ApplicationController def show @notification = current_user.notifications.find(params[:id]) @notification.mark_as_read - redirect_to linkable_resource_path(@notification) + redirect_to linkable_resource_path(@notification), allow_other_host: true end def read diff --git a/config/initializers/new_framework_defaults_7_0.rb b/config/initializers/new_framework_defaults_7_0.rb index 04b2bb5ad..343c33ced 100644 --- a/config/initializers/new_framework_defaults_7_0.rb +++ b/config/initializers/new_framework_defaults_7_0.rb @@ -61,7 +61,7 @@ Rails.application.config.active_record.verify_foreign_keys_for_fixtures = true 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 # Change the variant processor for Active Storage. # Changing this default means updating all places in your code that diff --git a/spec/controllers/remote_translations_controller_spec.rb b/spec/controllers/remote_translations_controller_spec.rb index e7685f46e..9832607e5 100644 --- a/spec/controllers/remote_translations_controller_spec.rb +++ b/spec/controllers/remote_translations_controller_spec.rb @@ -11,7 +11,7 @@ describe RemoteTranslationsController, :remote_translations do end before do - request.env["HTTP_REFERER"] = "any_path" + request.env["HTTP_REFERER"] = "/any_path" end it "create correctly remote translation" do @@ -39,7 +39,7 @@ describe RemoteTranslationsController, :remote_translations do it "redirect_to request referer after create" do post :create, params: { remote_translations: remote_translations_params } - expect(subject).to redirect_to("any_path") + expect(subject).to redirect_to "/any_path" end end end