6279: if hostname ends with .shell, strip it.
[arvados.git] / apps / workbench / app / controllers / actions_controller.rb
index 77abb6315615552394e732c043c877855b432a18..f1985a64284c52450d0f4fcd43f91e284e6cd814 100644 (file)
@@ -230,10 +230,13 @@ You can try recreating the collection to get a copy with full provenance data."
 
   expose_action :webshell do
     shell_in_a_box_url_config = Rails.configuration.shell_in_a_box_url
+
     return render_not_found if not shell_in_a_box_url_config
 
+    return unprocessable "Missing parameters" if not params['login'] or not params['hostname']
+
     @webshell_login = params['login']
-    @webshell_hostname = params['hostname']
+    @webshell_hostname = params['hostname'].chomp('.shell')
 
     if not shell_in_a_box_url_config.end_with?('/')
       shell_in_a_box_url_config += '/'