From 29d1d12dab6ac64e0bf104c005f3cff0312b9335 Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Sun, 30 Oct 2022 13:23:03 -0400 Subject: [PATCH] Actually use the videoID regex --- src/routes.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes.rs b/src/routes.rs index 5521aaa..3e48746 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -77,8 +77,9 @@ pub async fn skip_segments_by_id( db: Db, ) -> content::RawJson { - if videoID.is_empty() { - return content::RawJson("videoID is missing".to_string()); + // Check if ID matches ID regex + if !ID_RE.is_match(&videoID) { + return content::RawJson("videoID does not match format requirements".to_string()); } let sponsors = find_skip_segments(VideoName::ByID(videoID.clone()), categories, db).await;