From 1cf9c94f99fd78347cd772e47c86d557eac54fbc Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 11 Jun 2020 15:26:06 -0400 Subject: [PATCH] Fix double slash in URL. refs #16523 Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- apps/workbench/app/views/layouts/application.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb index 4fc7da9949..c0f01da283 100644 --- a/apps/workbench/app/views/layouts/application.html.erb +++ b/apps/workbench/app/views/layouts/application.html.erb @@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0 %> <% if current_user %> <% content_for :js do %> - window.defaultSession = <%=raw({baseURL: Rails.configuration.Services.Controller.ExternalURL.to_s.gsub(/\/?$/,'/'), token: Thread.current[:arvados_api_token], user: current_user}.to_json)%> + window.defaultSession = <%=raw({baseURL: Rails.configuration.Services.Controller.ExternalURL.to_s.sub(/\/*$/,'/'), token: Thread.current[:arvados_api_token], user: current_user}.to_json)%> <% end %> <% end %> <% if current_user and $arvados_api_client.discovery[:websocketUrl] %> @@ -49,7 +49,7 @@ SPDX-License-Identifier: AGPL-3.0 %> <%= yield :head %> <%= javascript_tag do %> angular.module('Arvados').value('arvadosApiToken', '<%=Thread.current[:arvados_api_token]%>'); - angular.module('Arvados').value('arvadosDiscoveryUri', '<%= Rails.configuration.Services.Controller.ExternalURL.to_s + '/discovery/v1/apis/arvados/v1/rest' %>'); + angular.module('Arvados').value('arvadosDiscoveryUri', '<%= Rails.configuration.Services.Controller.ExternalURL.to_s.sub(/\/*$/,'/') + 'discovery/v1/apis/arvados/v1/rest' %>'); <%= yield :js %> <% end %>