Skip to content

Commit

Permalink
strip ending "/" for repo url
Browse files Browse the repository at this point in the history
  • Loading branch information
lyang2821 committed Apr 17, 2024
1 parent e668ffb commit 58e5615
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lapdev-conductor/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,14 +526,17 @@ impl Conductor {

fn format_repo_url(&self, repo: &str) -> String {
let repo = repo.trim();
if !repo.starts_with("http://")
let repo = if !repo.starts_with("http://")
&& !repo.starts_with("https://")
&& !repo.starts_with("ssh://")
{
format!("https://{repo}")
} else {
repo.to_string()
}
};
repo.strip_suffix('/')
.map(|r| r.to_string())
.unwrap_or(repo)
}

async fn get_raw_repo_details(
Expand Down

0 comments on commit 58e5615

Please sign in to comment.