Skip to content

Commit

Permalink
Uri escape (#525)
Browse files Browse the repository at this point in the history
* Address URI.escape and URI.unescape deprecation to clean up logs

- Update solr_wrapper and fcrepo_wrapper gems in order to be able to run tests locally

Co-authored-by: fnibbit <[email protected]>
Co-authored-by: Chris Colvard <[email protected]>
Co-authored-by: Chris Colvard <[email protected]>
  • Loading branch information
4 people authored Mar 15, 2021
1 parent d2f44c4 commit cbb16e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def assign_attributes(attributes)
end

def agent_name
URI.decode(parsed_agent.last)
URI.decode_www_form_component(parsed_agent.last)
end

def update(*)
Expand Down Expand Up @@ -79,8 +79,11 @@ def build_agent(name, type)
end
end

# The current URL.hash standard (As of March 2021) is that the post-hash portion of the URL is not percent-decoded
# however in order to ensure backward compatibility with already recorded values we are normalizing
# the fragment here. See https://developer.mozilla.org/en-US/docs/Web/API/URL/hash
def build_agent_resource(prefix, name)
[Agent.new(::RDF::URI.new("#{prefix}##{URI.encode(name)}"))]
[Agent.new(::RDF::URI.new("#{prefix}##{URI.encode(name)}").normalize!)]
end

def build_access(access)
Expand Down
6 changes: 3 additions & 3 deletions hydra-head.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Gem::Specification.new do |s|

s.add_dependency 'hydra-access-controls', version
s.add_dependency 'hydra-core', version
s.add_dependency 'rails', '>= 5.2', '< 6.1'
s.add_dependency 'rails', '>= 5.2.4', '< 6.1'

s.add_development_dependency 'coveralls'
s.add_development_dependency 'engine_cart', '~> 2.2'
s.add_development_dependency 'factory_bot'
s.add_development_dependency 'fcrepo_wrapper', '~> 0.6'
s.add_development_dependency 'fcrepo_wrapper', '~> 0.9'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'simplecov'
s.add_development_dependency 'solr_wrapper', '~> 0.18'
s.add_development_dependency 'solr_wrapper', '~> 3'
s.add_development_dependency 'rspec_junit_formatter'
end

0 comments on commit cbb16e3

Please sign in to comment.