Skip to content

PrefixStore::head doesn't strip prefix from meta.location #664

@liamdiprose

Description

@liamdiprose

Describe the bug

Calling .head() on a prefix store returns an ObjectMeta with a .location that contains the prefix. Other methods such as .list() strip the prefix: https://docs.rs/object_store/latest/src/object_store/prefix.rs.html#146

To Reproduce

let store = PrefixStore::new("client-jail", InMemory::new());
let path = Path::from("my-file");
match store.head(&path).await {
  Ok(meta) => {
    store.get(meta.location).await.expect("to not try open client-jail/client-jail/my-file");
  ...

Expected behavior

From prefix.rs, I think PrefixStore's head() method needs to call strip_meta.

Current Workaround
Reusing the path passed into head().

Thank you ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions