You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 6, 2024. It is now read-only.
This creates a special kind of hell for implementers, especially JS, where not all binary can go through the binary string js unescape/charCodeAt safely, 😿 Original spec was aiming to mitigate it by using plain text DAG-JSON OR multibase-encoded DAG-CBOR, as we know JS libraries for these do the right thing and no data corruption can occur.
Solution
Follow the spec, switch to percent-encoded DAG-JSON, but make it backward-compatible with format sent by Kubo 0.16:
If DAG-JSON fails to parse, a fallback to current (invalid) percent-encoded-CBOR-as-string parser should occur.
Problem
The specification we've cleaned up in ipfs/specs#326 states that the value from
?q=value
is percent-encoded DAG-JSON.Turns out the edelweiss uses percent-encoded CBOR.
Example:
pd8 "github.com/ipld/go-ipld-prime/codec/dagcbor"
(and not dag-json) is used in places like https://github.com/ipfs/go-delegated-routing/blob/2646f6227c9411fc8825d9fed51a05cf2b740cab/gen/proto/proto_edelweiss.go#L1873-L1876This creates a special kind of hell for implementers, especially JS, where not all binary can go through the binary string js
unescape
/charCodeAt
safely, 😿 Original spec was aiming to mitigate it by using plain text DAG-JSON OR multibase-encoded DAG-CBOR, as we know JS libraries for these do the right thing and no data corruption can occur.Solution
Follow the spec, switch to percent-encoded DAG-JSON, but make it backward-compatible with format sent by Kubo 0.16:
If DAG-JSON fails to parse, a fallback to current (invalid) percent-encoded-CBOR-as-string parser should occur.
Test sample
Kubo 0.16 sends:
The text was updated successfully, but these errors were encountered: