This commit is contained in:
Simon
2025-09-03 12:33:21 +00:00
parent 31adceb3e9
commit c7e67a3cba
2 changed files with 3 additions and 3 deletions

View File

@@ -1012,7 +1012,7 @@ async fn videos_post(
let mut conn = pool.get().expect("couldn't get db connection from pool");
// Ensure "videos" table exists with two string columns
if !(db::has_table(&mut conn, "videos").unwrap()){
db::create_table(&mut conn, "CREATE TABLE videos (id TEXT NOT NULL, url TEXT NOT NULL);");
let _ = db::create_table(&mut conn, "CREATE TABLE videos (id TEXT NOT NULL, url TEXT NOT NULL);");
}
let mut videos = Videos {

View File

@@ -28,8 +28,8 @@ async fn sxyprn(req: HttpRequest,
url if url != "" => url,
_ => "Error".to_string(),
};
Ok(web::HttpResponse::Found()
.header("Location", video_url)
Ok(web::HttpResponse::MovedPermanently()
.header("Location", format!("https:{}", video_url))
.finish())
}