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