production fix

This commit is contained in:
Simon
2026-08-05 14:13:41 +00:00
parent 361d8e785c
commit 2b491995f2
3 changed files with 59 additions and 16 deletions

View File

@@ -197,10 +197,10 @@ async fn proxy2redirect(
) -> Result<impl web::Responder, web::Error> {
let proxy = get_proxy(req.uri().to_string().split("/").collect::<Vec<&str>>()[2]).unwrap();
let endpoint = req.match_info().query("endpoint").to_string();
let video_url = match proxy.get_video_url(endpoint, requester).await {
url if url != "" => url,
_ => "Error".to_string(),
};
let video_url = proxy.get_video_url(endpoint, requester).await;
if video_url.is_empty() {
return Ok(web::HttpResponse::BadGateway().finish());
}
Ok(web::HttpResponse::Found()
.header("Location", video_url)
.finish())