Sha256: 526feb08e474537c2a109b8ac80e367128e7c4fe354d8b19772b0219f99184aa

Contents?: true

Size: 741 Bytes

Versions: 29

Compression:

Stored size: 741 Bytes

Contents

# frozen_string_literal: true
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

29 entries across 29 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/connections/hyrax/clean_connection.rb
hyrax-5.0.4 app/connections/hyrax/clean_connection.rb
hyrax-5.0.3 app/connections/hyrax/clean_connection.rb
hyrax-5.0.2 app/connections/hyrax/clean_connection.rb
hyrax-5.0.1 app/connections/hyrax/clean_connection.rb
hyrax-5.0.0 app/connections/hyrax/clean_connection.rb
hyrax-5.0.0.rc3 app/connections/hyrax/clean_connection.rb
hyrax-5.0.0.rc2 app/connections/hyrax/clean_connection.rb
hyrax-5.0.0.rc1 app/connections/hyrax/clean_connection.rb
hyrax-3.6.0 app/connections/hyrax/clean_connection.rb
hyrax-4.0.0 app/connections/hyrax/clean_connection.rb
hyrax-4.0.0.rc3 app/connections/hyrax/clean_connection.rb
hyrax-4.0.0.rc2 app/connections/hyrax/clean_connection.rb
hyrax-4.0.0.rc1 app/connections/hyrax/clean_connection.rb
hyrax-3.5.0 app/connections/hyrax/clean_connection.rb
hyrax-4.0.0.beta2 app/connections/hyrax/clean_connection.rb
hyrax-3.4.2 app/connections/hyrax/clean_connection.rb
hyrax-4.0.0.beta1 app/connections/hyrax/clean_connection.rb
hyrax-3.4.1 app/connections/hyrax/clean_connection.rb
hyrax-3.4.0 app/connections/hyrax/clean_connection.rb