diff --git a/app/overrides/lib/active-fedora/fedora_override.rb b/app/overrides/lib/active-fedora/fedora_override.rb new file mode 100644 index 000000000..cc12124c4 --- /dev/null +++ b/app/overrides/lib/active-fedora/fedora_override.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true +# https://github.com/samvera/active_fedora/blob/v14.0.1/lib/active_fedora/fedora.rb +ActiveFedora::Fedora.class_eval do + def authorized_connection + options = {} + options[:ssl] = ssl_options if ssl_options + options[:request] = request_options if request_options + Faraday.new(host, options) do |conn| + conn.response :encoding # use Faraday::Encoding middleware + conn.adapter Faraday.default_adapter # net/http + # [hyc-override] Setting timeout to 5 minutes to allow for deposit of large files (default: 60) + conn.options.timeout = 60 * 5 + if Gem::Version.new(Faraday::VERSION) < Gem::Version.new('2') + conn.request :basic_auth, user, password + else + conn.request :authorization, :basic, user, password + end + end + end +end diff --git a/config/fedora.yml b/config/fedora.yml index ced226613..b7973b861 100755 --- a/config/fedora.yml +++ b/config/fedora.yml @@ -1,3 +1,6 @@ +default: &default + request: + timeout: 300 development: user: fedoraAdmin password: fedoraAdmin