production fix
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user