Merge branch 'master' into 2919-provenance-graph-cutoff
[arvados.git] / services / api / app / controllers / arvados / v1 / collections_controller.rb
index 1982a525f7c03366a5174e10d39e9e0a53bd96d0..6c9d41e3f1f468c2a49a9b7f018923668acd63f1 100644 (file)
@@ -43,11 +43,12 @@ class Arvados::V1::CollectionsController < ApplicationController
     # Remove any permission signatures from the manifest.
     resource_attrs[:manifest_text]
       .gsub!(/ [[:xdigit:]]{32}(\+[[:digit:]]+)?(\+\S+)/) { |word|
+      word.strip!
       loc = Locator.parse(word)
       if loc
         " " + loc.without_signature.to_s
       else
-        word
+        " " + word
       end
     }
 
@@ -94,11 +95,12 @@ class Arvados::V1::CollectionsController < ApplicationController
       }
       @object[:manifest_text]
         .gsub!(/ [[:xdigit:]]{32}(\+[[:digit:]]+)?(\+\S+)/) { |word|
+        word.strip!
         loc = Locator.parse(word)
         if loc
           " " + Blob.sign_locator(word, signing_opts)
         else
-          word
+          " " + word
         end
       }
     end