update remove_endpoint_http_or_s
This commit is contained in:
@@ -103,10 +103,10 @@ impl OSSClient {
|
|||||||
// https://endpoint, or http://endpoint -> endpoint
|
// https://endpoint, or http://endpoint -> endpoint
|
||||||
fn remove_endpoint_http_or_s(endpoint: &str) -> String {
|
fn remove_endpoint_http_or_s(endpoint: &str) -> String {
|
||||||
let mut endpoint = endpoint.to_owned();
|
let mut endpoint = endpoint.to_owned();
|
||||||
if endpoint.starts_with("http://") {
|
for prefix in vec!["http://", "https://"] {
|
||||||
endpoint = endpoint.chars().skip("http://".chars().count()).collect::<String>();
|
if endpoint.starts_with(prefix) {
|
||||||
} else if endpoint.starts_with("https://") {
|
endpoint = endpoint.chars().skip(prefix.chars().count()).collect::<String>()
|
||||||
endpoint = endpoint.chars().skip("https://".chars().count()).collect::<String>();
|
}
|
||||||
}
|
}
|
||||||
endpoint
|
endpoint
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user