Sha256: 0507fc1d72703ad244e82313cf3f311a36f46e34a57e9776cf4e4f1d1ec28111

Contents?: true

Size: 727 Bytes

Versions: 58

Compression:

Stored size: 727 Bytes

Contents

module Hyrax
  # This stands in for ActiveFedora::CleanConnection. It behaves the same way,
  # but it doesn't clear the has_model assertion
  class CleanConnection < SimpleDelegator
    def get(*args)
      result = __getobj__.get(*args) do |req|
        prefer_headers = Ldp::PreferHeaders.new(req.headers["Prefer"])
        prefer_headers.omit = prefer_headers.omit | omit_uris
        req.headers["Prefer"] = prefer_headers.to_s
      end
      result
    end

    private

      def omit_uris
        [
          ::RDF::Vocab::Fcrepo4.ServerManaged,
          ::RDF::Vocab::LDP.PreferContainment,
          ::RDF::Vocab::LDP.PreferEmptyContainer,
          ::RDF::Vocab::LDP.PreferMembership
        ]
      end
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
hyrax-2.9.6 app/connections/hyrax/clean_connection.rb
hyrax-2.9.5 app/connections/hyrax/clean_connection.rb
hyrax-2.9.4 app/connections/hyrax/clean_connection.rb
hyrax-2.9.3 app/connections/hyrax/clean_connection.rb
hyrax-2.9.2 app/connections/hyrax/clean_connection.rb
hyrax-2.9.1 app/connections/hyrax/clean_connection.rb
hyrax-2.9.0 app/connections/hyrax/clean_connection.rb
hyrax-2.8.0 app/connections/hyrax/clean_connection.rb
hyrax-2.7.2 app/connections/hyrax/clean_connection.rb
hyrax-2.7.1 app/connections/hyrax/clean_connection.rb
hyrax-2.7.0 app/connections/hyrax/clean_connection.rb
hyrax-2.6.0 app/connections/hyrax/clean_connection.rb
hyrax-3.0.0.pre.rc1 app/connections/hyrax/clean_connection.rb
hyrax-3.0.0.pre.beta3 app/connections/hyrax/clean_connection.rb
hyrax-2.5.1 app/connections/hyrax/clean_connection.rb
hyrax-2.5.0 app/connections/hyrax/clean_connection.rb
hyrax-3.0.0.pre.beta2 app/connections/hyrax/clean_connection.rb
hyrax-2.4.1 app/connections/hyrax/clean_connection.rb
hyrax-3.0.0.pre.beta1 app/connections/hyrax/clean_connection.rb
hyrax-2.4.0 app/connections/hyrax/clean_connection.rb