fix: Wrong regex in validate_link, fixes #6

This commit is contained in:
Sayantan Santra 2024-03-10 18:18:07 -05:00
parent a32f00c36e
commit 0bfaa49e7b
Signed by: SinTan1729
GPG Key ID: EB3E68BFBA25C85F
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}