Add a way to reset password
This commit is contained in:
parent
5d343c273f
commit
ed979719b5
12 changed files with 352 additions and 57 deletions
|
|
@ -18,3 +18,24 @@ pub fn get_ip_and_user_agent(headers: &HeaderMap, remote_address: SocketAddr) ->
|
|||
|
||||
(ip, user_agent)
|
||||
}
|
||||
|
||||
pub fn get_url_from_host(host: &str) -> String {
|
||||
let port: Option<u16> = 'p: {
|
||||
let split_port: Vec<&str> = host.split(':').collect();
|
||||
if split_port.len() == 2 {
|
||||
if let Ok(p) = split_port[1].parse::<u16>() {
|
||||
break 'p Some(p);
|
||||
}
|
||||
}
|
||||
None
|
||||
};
|
||||
format!(
|
||||
"http{}://{}",
|
||||
if port.is_some() && port.unwrap() != 443 {
|
||||
""
|
||||
} else {
|
||||
"s"
|
||||
},
|
||||
host
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue