diff --git a/Gemfile b/Gemfile index ceea39185b..f890e57901 100644 --- a/Gemfile +++ b/Gemfile @@ -70,7 +70,7 @@ gem 'omniauth-lti', git: "https://github.com/avalonmediasystem/omniauth-lti.git" gem "omniauth-saml", "~> 2.0" # Media Access & Transcoding -gem 'active_encode', '~> 1.0' +gem 'active_encode', '~> 1.0', '>= 1.1.2' gem 'audio_waveform-ruby', '~> 1.0.7', require: 'audio_waveform' gem 'browse-everything', git: "https://github.com/avalonmediasystem/browse-everything.git", branch: 'v1.2-avalon' gem 'fastimage' diff --git a/Gemfile.lock b/Gemfile.lock index c668f9b0a3..139ef8e76a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -132,7 +132,7 @@ GEM active_elastic_job (3.2.0) aws-sdk-sqs (~> 1) rails (>= 5.2.6, < 7.1) - active_encode (1.1.1) + active_encode (1.1.2) addressable (~> 2.8) rails active_fedora-datastreams (0.4.0) @@ -959,7 +959,7 @@ DEPENDENCIES active-fedora (~> 13.2, >= 13.2.5) active_annotations (~> 0.4) active_elastic_job - active_encode (~> 1.0) + active_encode (~> 1.0, >= 1.1.2) active_fedora-datastreams (~> 0.4) activejob-traffic_control activejob-uniqueness diff --git a/app/services/file_locator.rb b/app/services/file_locator.rb index e4d56755d0..cb260d1aab 100644 --- a/app/services/file_locator.rb +++ b/app/services/file_locator.rb @@ -1,11 +1,11 @@ # Copyright 2011-2022, The Trustees of Indiana University and Northwestern # University. Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -# +# # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software distributed # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR # CONDITIONS OF ANY KIND, either express or implied. See the License for the @@ -24,7 +24,7 @@ class S3File def initialize(uri) uri = Addressable::URI.parse(uri) @bucket = Addressable::URI.unencode(uri.host) - @key = Addressable::URI.unencode(uri.path).sub(%r(^/*(.+)/*$),'\1') + @key = Addressable::URI.unencode(ActiveEncode.sanitize_uri(uri)).sub(%r(^/*(.+)/*$),'\1') end def object