samvera / active_fedora

A Rails interface to the Fedora repository, akin to ActiveModel
Other
54 stars 63 forks source link

Escape ids #941

Open jcoyne opened 8 years ago

jcoyne commented 8 years ago
FileSet.find('[foob]')
Attempted to init base path `prod`, but it already exists
URI::InvalidURIError: bad URI(is not URI?): http://127.0.0.1:8080/fedora/rest/prod/[f/oo/b]/[foob]
    from /usr/local/lib/ruby/2.2.0/uri/rfc3986_parser.rb:66:in `split'
    from /usr/local/lib/ruby/2.2.0/uri/rfc3986_parser.rb:72:in `parse'
    from /usr/local/lib/ruby/2.2.0/uri/common.rb:226:in `parse'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/ldp-0.4.1/lib/ldp/client/methods.rb:157:in `munge_to_relative_url'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/ldp-0.4.1/lib/ldp/client/methods.rb:20:in `block (2 levels) in head'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:142:in `block in head'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:374:in `block in run_request'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:388:in `block in build_request'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/faraday-0.9.2/lib/faraday/request.rb:26:in `block in create'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/faraday-0.9.2/lib/faraday/request.rb:25:in `tap'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/faraday-0.9.2/lib/faraday/request.rb:25:in `create'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:384:in `build_request'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:370:in `run_request'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:140:in `head'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/ldp-0.4.1/lib/ldp/client/methods.rb:19:in `block in head'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/notifications.rb:166:in `instrument'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/ldp-0.4.1/lib/ldp/client/methods.rb:17:in `head'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/ldp-0.4.1/lib/ldp/resource.rb:48:in `head'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/ldp-0.4.1/lib/ldp/resource.rb:31:in `new?'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/active-fedora-9.6.1/lib/active_fedora/relation/finder_methods.rb:187:in `load_from_fedora'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/active-fedora-9.6.1/lib/active_fedora/relation/finder_methods.rb:174:in `find_one'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/active-fedora-9.6.1/lib/active_fedora/relation/finder_methods.rb:233:in `find_with_ids'
    from /opt/goldenseal/shared/bundle/ruby/2.2.0/gems/active-fedora-9.6.1/lib/active_fedora/relation/finder_methods.rb:58:in `find'
jcoyne commented 8 years ago

Still seems to be happening:

Attempted to init base path `dev`, but it already exists
URI::InvalidURIError: bad URI(is not URI?): http://127.0.0.1:8983/fedora/rest/dev/[f/ro/b]/[frob]
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:66:in `split'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:72:in `parse'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/2.2.0/uri/common.rb:226:in `parse'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ldp-0.4.1/lib/ldp/client/methods.rb:157:in `munge_to_relative_url'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ldp-0.4.1/lib/ldp/client/methods.rb:20:in `block (2 levels) in head'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:142:in `block in head'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:374:in `block in run_request'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:388:in `block in build_request'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/request.rb:26:in `block in create'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/request.rb:25:in `tap'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/request.rb:25:in `create'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:384:in `build_request'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:370:in `run_request'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:140:in `head'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ldp-0.4.1/lib/ldp/client/methods.rb:19:in `block in head'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.4/lib/active_support/notifications.rb:166:in `instrument'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ldp-0.4.1/lib/ldp/client/methods.rb:17:in `head'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ldp-0.4.1/lib/ldp/resource.rb:48:in `head'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ldp-0.4.1/lib/ldp/resource.rb:31:in `new?'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/active-fedora-9.6.2/lib/active_fedora/relation/finder_methods.rb:187:in `load_from_fedora'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/active-fedora-9.6.2/lib/active_fedora/relation/finder_methods.rb:174:in `find_one'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/active-fedora-9.6.2/lib/active_fedora/relation/finder_methods.rb:233:in `find_with_ids'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/active-fedora-9.6.2/lib/active_fedora/relation/finder_methods.rb:58:in `find'
        from /Users/justin/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/active-fedora-9.6.2/lib/active_fedora/querying.rb:3:in `find'