From 17356c30454f503d1b8e3e20e73f0babd36354c0 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 19 Dec 2022 16:06:47 +0100 Subject: [PATCH] Allow redirect to main CodeOcean host When a file cannot be retrieved any longer, we send a redirect to the previous locations. As we usually enable a different render host, Rails sees this redirect as a redirect to another host (from the render host to the main CodeOcean host). --- app/controllers/live_streams_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/live_streams_controller.rb b/app/controllers/live_streams_controller.rb index c1af67ef..2bbe7994 100644 --- a/app/controllers/live_streams_controller.rb +++ b/app/controllers/live_streams_controller.rb @@ -12,7 +12,7 @@ class LiveStreamsController < ApplicationController # Using the submission ID parameter would allow looking up the corresponding exercise ID # Therefore, we just redirect to the root_path, but actually expect to redirect back (that should work!) skip_authorization - redirect_back(fallback_location: root_path, alert: t('exercises.download_file_tree.gone')) + redirect_back(fallback_location: root_path, allow_other_host: true, alert: t('exercises.download_file_tree.gone')) else desired_file = params[:filename].to_s runner = Runner.for(current_user, @submission.exercise.execution_environment)