[ARVADOS] updated: 085876306dd42d59d97b251e135e6cd157af4216

git at public.curoverse.com git at public.curoverse.com
Thu Jun 19 15:14:13 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/collections_controller.rb      | 2 +-
 apps/workbench/app/views/collections/show_file_links.html.erb | 7 +++----
 apps/workbench/test/functional/collections_controller_test.rb | 8 ++++++++
 3 files changed, 12 insertions(+), 5 deletions(-)

       via  085876306dd42d59d97b251e135e6cd157af4216 (commit)
       via  7e723d29f206fcc5ba4d8a26f8d547a72d5f0425 (commit)
      from  ebc3fddd97628a50148ed90531b0a18d1cc867f9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 085876306dd42d59d97b251e135e6cd157af4216
Author: Brett Smith <brett at curoverse.com>
Date:   Thu Jun 19 15:14:57 2014 -0400

    Refactor show_file_links.html.erb to reduce duplication.
    
    No issue #, just something I did while working on the previous commit.

diff --git a/apps/workbench/app/views/collections/show_file_links.html.erb b/apps/workbench/app/views/collections/show_file_links.html.erb
index 22baaa8..042e4ff 100644
--- a/apps/workbench/app/views/collections/show_file_links.html.erb
+++ b/apps/workbench/app/views/collections/show_file_links.html.erb
@@ -59,9 +59,7 @@ the entire collection with wget, try:</p>
       <ul class="collection_files">
     <% else %>
       <%= link_to(filename,
-                  {controller: 'collections', action: 'show_file',
-                   uuid: @object.uuid, file: file_path,
-                   reader_token: params[:reader_token]},
+                  link_opts.merge(file: file_path),
                   {title: "Download #{file_path}"}) %>
       </li>
     <% end %>

commit 7e723d29f206fcc5ba4d8a26f8d547a72d5f0425
Author: Brett Smith <brett at curoverse.com>
Date:   Thu Jun 19 15:14:07 2014 -0400

    2937: Make sure Collection share links end with /.
    
    This is necessary to prevent wget from saving a plain HTML file with
    the name of the reader token.  With a file there, it's not possible to
    make a directory tree for recursive downloads.
    
    Closes #2937.

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index fa83714..dd85b2f 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -198,7 +198,7 @@ class CollectionsController < ApplicationController
   helper_method :download_link
 
   def download_link
-    collections_url + "/download/#{@object.uuid}/#{@search_sharing.first.api_token}"
+    collections_url + "/download/#{@object.uuid}/#{@search_sharing.first.api_token}/"
   end
 
   def share
diff --git a/apps/workbench/app/views/collections/show_file_links.html.erb b/apps/workbench/app/views/collections/show_file_links.html.erb
index 78d75b1..22baaa8 100644
--- a/apps/workbench/app/views/collections/show_file_links.html.erb
+++ b/apps/workbench/app/views/collections/show_file_links.html.erb
@@ -38,7 +38,8 @@ Arvados.  You can download individual files listed below.  To download
 the entire collection with wget, try:</p>
 
 <pre>$ wget --mirror --no-parent --no-host --cut-dirs=3 <%=
-         url_for(link_opts.merge(action: 'show_file_links', only_path: false))
+         url_for(link_opts.merge(action: 'show_file_links', only_path: false,
+                                 trailing_slash: true))
        %></pre>
 
 <h2>File Listing</h2>
diff --git a/apps/workbench/test/functional/collections_controller_test.rb b/apps/workbench/test/functional/collections_controller_test.rb
index fb80f88..babe4fb 100644
--- a/apps/workbench/test/functional/collections_controller_test.rb
+++ b/apps/workbench/test/functional/collections_controller_test.rb
@@ -98,6 +98,14 @@ class CollectionsControllerTest < ActionController::TestCase
     assert_no_session
   end
 
+  test "reader token Collection links end with trailing slash" do
+    # Testing the fix for #2937.
+    show_collection(:foo_file, :active_trustedclient)
+    post(:share, collection_params(:foo_file))
+    assert(@controller.download_link.ends_with? '/',
+           "Collection share link does not end with slash for wget")
+  end
+
   test "getting a file from Keep" do
     params = collection_params(:foo_file, 'foo')
     sess = session_for(:active)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list