fixed a bug where the url was wrongly formatted
This commit is contained in:
@@ -67,7 +67,7 @@ impl SxyprnProxy {
|
|||||||
let response = requester.get_raw(&sxyprn_video_url).await;
|
let response = requester.get_raw(&sxyprn_video_url).await;
|
||||||
match response {
|
match response {
|
||||||
Ok(resp) => {
|
Ok(resp) => {
|
||||||
return resp.headers().get("Location").unwrap().to_str().unwrap_or("").to_string();
|
return format!("https:{}", resp.headers().get("Location").unwrap().to_str().unwrap_or("").to_string());
|
||||||
},
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Error fetching video URL: {}", e);
|
println!("Error fetching video URL: {}", e);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ async fn proxy2redirect(req: HttpRequest,
|
|||||||
_ => "Error".to_string(),
|
_ => "Error".to_string(),
|
||||||
};
|
};
|
||||||
Ok(web::HttpResponse::Found()
|
Ok(web::HttpResponse::Found()
|
||||||
.header("Location", format!("https:{}", video_url))
|
.header("Location", video_url)
|
||||||
.finish())
|
.finish())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user