X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f6911c2c1b39de18b136a6cf9566dba3089b33c2..442d78e1fb39f5d18f728f083e04f320ced44ebb:/services/api/app/controllers/static_controller.rb diff --git a/services/api/app/controllers/static_controller.rb b/services/api/app/controllers/static_controller.rb index f64e9a41fa..b7693f3420 100644 --- a/services/api/app/controllers/static_controller.rb +++ b/services/api/app/controllers/static_controller.rb @@ -1,10 +1,31 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class StaticController < ApplicationController + respond_to :json, :html - skip_before_filter :find_object_by_uuid - skip_before_filter :require_auth_scope_all, :only => [ :home, :login_failure ] + skip_before_action :find_object_by_uuid + skip_before_action :render_404_if_no_object + skip_before_action :require_auth_scope, only: [:home, :empty, :login_failure] def home - redirect_to Rails.configuration.workbench_address + respond_to do |f| + f.html do + if !Rails.configuration.Services.Workbench1.ExternalURL.to_s.empty? + redirect_to Rails.configuration.Services.Workbench1.ExternalURL.to_s, allow_other_host: true + else + render_not_found "Oops, this is an API endpoint. You probably want to point your browser to an Arvados Workbench site instead." + end + end + f.json do + render_not_found "Path not found." + end + end + end + + def empty + render plain: "" end end