mirror of
https://github.com/SinTan1729/chhoto-url
synced 2024-12-25 23:28:37 -06:00
fix: Wrong regex in validate_link, fixes #6
This commit is contained in:
parent
a32f00c36e
commit
0bfaa49e7b
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ pub fn get_longurl(shortlink: String, db: &Connection) -> String {
|
|||
}
|
||||
|
||||
fn validate_link(link: &str) -> bool {
|
||||
let re = Regex::new("[a-z0-9-_]+").unwrap();
|
||||
let re = Regex::new("^[a-z0-9-_]+$").unwrap();
|
||||
re.is_match(link)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue