Instance::from_root_url(root_url: &str, limited: bool): Creates a new Instance by trying to get the relevant instance urls (UrlBundle) from a root url. Shorthand for Instance::new(UrlBundle::from_root_domain(root_domain).await?)
UrlBundle::from_root_url(url: &str): Performs a few HTTP requests to try and retrieve a UrlBundle from an instance's root URL. The method tries to retrieve the UrlBundle via these three strategies, in order:
GET: $url/.well-known/spacebar -> Retrieve UrlBundle via $wellknownurl/api/policies/instance/domains
GET: $url/api/policies/instance/domains
GET: $url/policies/instance/domains
The URL stored at .well-known/spacebar is the instance's API endpoint. The API stores the CDN and WSS URLs under the $api/policies/instance/domains endpoint. If all three of the above approaches fail, it is very likely that the instance is misconfigured, unreachable, or that a wrong URL was provided.
Closes #449.
Instance::from_root_url(root_url: &str, limited: bool)
: Creates a new Instance by trying to get the relevant instance urls (UrlBundle) from a root url. Shorthand forInstance::new(UrlBundle::from_root_domain(root_domain).await?)
UrlBundle::from_root_url(url: &str)
: Performs a few HTTP requests to try and retrieve a UrlBundle from an instance's root URL. The method tries to retrieve the UrlBundle via these three strategies, in order:The URL stored at .well-known/spacebar is the instance's API endpoint. The API stores the CDN and WSS URLs under the $api/policies/instance/domains endpoint. If all three of the above approaches fail, it is very likely that the instance is misconfigured, unreachable, or that a wrong URL was provided.
clippy::todo, clippy::unimplemented, clippy::dbg_macro, clippy::print_stdout, clippy::print_stderr