fixes?
This commit is contained in:
@@ -1012,7 +1012,7 @@ async fn videos_post(
|
|||||||
let mut conn = pool.get().expect("couldn't get db connection from pool");
|
let mut conn = pool.get().expect("couldn't get db connection from pool");
|
||||||
// Ensure "videos" table exists with two string columns
|
// Ensure "videos" table exists with two string columns
|
||||||
if !(db::has_table(&mut conn, "videos").unwrap()){
|
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 {
|
let mut videos = Videos {
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ async fn sxyprn(req: HttpRequest,
|
|||||||
url if url != "" => url,
|
url if url != "" => url,
|
||||||
_ => "Error".to_string(),
|
_ => "Error".to_string(),
|
||||||
};
|
};
|
||||||
Ok(web::HttpResponse::Found()
|
Ok(web::HttpResponse::MovedPermanently()
|
||||||
.header("Location", video_url)
|
.header("Location", format!("https:{}", video_url))
|
||||||
.finish())
|
.finish())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user