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
When a component value has a / in it, it becomes hard to round-trip a multiaddr from bytes to a string and back again, since it's unclear where the value ends and the next protocol component starts.
A growing list of where this is relevant:
/http-path has solved this problem by url-encoding the value (see Define /http-path #164).
Potentially adding libp2p protocols to multiaddrs has come up in chore: add tag code multicodec#380 (yes, wrong repo) which are full of / characters.
In the scope of define a string representation for unparsable multiaddresses #155 - where we might parse a multiaddr from a string that contains protocol components we don't understand, for example /ip4/123.123.123.123/my-new-protocol/herp/derp. The unknown protocol would be easier to ignore if it was encountered as /ip4/123.123.123.123/my-new-protocol/herp%2Fderp (though obviously it can't be round-tripped as we don't know what the protocol code for my-new-protocol is).
Perhaps it's time to specify how to handle this character properly?
Represent it in the string version of a multiaddr as %2F?
When a component value has a
/in it, it becomes hard to round-trip a multiaddr from bytes to a string and back again, since it's unclear where the value ends and the next protocol component starts.A growing list of where this is relevant:
/http-pathhas solved this problem by url-encoding the value (see Define/http-path#164)./unixneeds a similar solution: Define/unix#174/characters./ip4/123.123.123.123/my-new-protocol/herp/derp. The unknown protocol would be easier to ignore if it was encountered as/ip4/123.123.123.123/my-new-protocol/herp%2Fderp(though obviously it can't be round-tripped as we don't know what the protocol code formy-new-protocolis).Perhaps it's time to specify how to handle this character properly?
Represent it in the string version of a multiaddr as
%2F?