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
Currently users have to pass a impl AsRef<str> to the client builder that includes a port.
I know there have been other issues (#554, paritytech/subxt#644) about this, and it is marked as blocked on hyperium/http#509. But I would still like to advocate once more for jsonrpsee handling of a default port when passing a URL to it.
As a library user, I expect that I could pass a valid URL to jsonrpsee. The URL standard says that the port should be omitted if it is the default port. This is also what users expect.
The problem is further amplified by rust url and http crates. If an application takes user input and parses it to an url::Url, the default port gets lost, and there is no nice way to force the crate to add it back when converting to string. http::Uri does not remove the default port, but is not able to provide the default port for different schemes (Url has at least port_or_known_default) if none was provided. As result, every application that takes a user-provided URL and passes it on to jsonrpsee needs to fiddle with the ports.
Currently users have to pass a
impl AsRef<str>
to the client builder that includes a port.I know there have been other issues (#554, paritytech/subxt#644) about this, and it is marked as blocked on hyperium/http#509. But I would still like to advocate once more for jsonrpsee handling of a default port when passing a URL to it.
As a library user, I expect that I could pass a valid URL to jsonrpsee. The URL standard says that the port should be omitted if it is the default port. This is also what users expect.
The problem is further amplified by rust
url
andhttp
crates. If an application takes user input and parses it to anurl::Url
, the default port gets lost, and there is no nice way to force the crate to add it back when converting to string.http::Uri
does not remove the default port, but is not able to provide the default port for different schemes (Url
has at least port_or_known_default) if none was provided. As result, every application that takes a user-provided URL and passes it on to jsonrpsee needs to fiddle with the ports.Ideas:
build_with_components(scheme, host, port, path ...)
which would add some convenienceThe text was updated successfully, but these errors were encountered: