pds http
This commit is contained in:
@@ -12,7 +12,11 @@ pub struct Endpoint {
|
|||||||
|
|
||||||
/// Build XRPC URL for an endpoint
|
/// Build XRPC URL for an endpoint
|
||||||
pub fn url(pds: &str, endpoint: &Endpoint) -> String {
|
pub fn url(pds: &str, endpoint: &Endpoint) -> String {
|
||||||
format!("https://{}/xrpc/{}", pds, endpoint.nsid)
|
let host = pds
|
||||||
|
.strip_prefix("https://")
|
||||||
|
.or_else(|| pds.strip_prefix("http://"))
|
||||||
|
.unwrap_or(pds);
|
||||||
|
format!("https://{}/xrpc/{}", host, endpoint.nsid)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod app_bsky_actor {
|
pub mod app_bsky_actor {
|
||||||
|
|||||||
Reference in New Issue
Block a user