Skip to content

Commit

Permalink
Optimized keep alive URL parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
rushi3691 committed Mar 26, 2024
1 parent 5e8cbb4 commit 1c803e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src-tauri/src/fortinet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ pub async fn login(
.ok_or("Keep alive url not found")?
.inner_html()
.split("\"")
.collect::<Vec<&str>>()[1]
.nth(1)
.ok_or("Keep alive url not found")?
.to_string();
println!("{}", keep_alive_url);

let session_id = keep_alive_url.split('?').collect::<Vec<&str>>()[1];
// let session_id = keep_alive_url.split('?').collect::<Vec<&str>>()[1];
let session_id = keep_alive_url.split("?").nth(1).ok_or("Session id not found")?;
println!("{}", session_id);

Ok(())
Expand Down

0 comments on commit 1c803e6

Please sign in to comment.