-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: force raw codec if requested #644
Conversation
f727613
to
bb82c3e
Compare
.await; | ||
assert_eq!(http::StatusCode::OK, res.status()); | ||
let body = hyper::body::to_bytes(res.into_body()).await.unwrap(); | ||
let ufs = iroh_unixfs::unixfs::UnixfsNode::decode(&test_setup.root_cid, body).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am slightly confused on how to unpack this further without significantly complicating things.
// Resolve the root block. | ||
let (root_cid, loaded_cid) = self.resolve_root(&path, &mut ctx).await?; | ||
match loaded_cid.source { | ||
Source::Store(_) => inc!(ResolverMetrics::CacheHit), | ||
_ => inc!(ResolverMetrics::CacheMiss), | ||
} | ||
|
||
let codec = Codec::try_from(root_cid.codec()).context("unknown codec")?; | ||
let codec = match force_raw { | ||
true => Codec::Raw, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this works, but is really misusing the current setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I guess it works for now
@dignifiedquire where we at with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets ship it for now
Closes n0-computer/beetle#98