mirror of
https://github.com/TeamPiped/piped-proxy.git
synced 2024-08-14 23:50:45 +00:00
Only do UMP handling on web client.
This commit is contained in:
parent
b0381834f6
commit
e223e1e22e
1 changed files with 3 additions and 2 deletions
|
@ -277,6 +277,7 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
|
||||||
|
|
||||||
let video_playback = req.path().eq("/videoplayback");
|
let video_playback = req.path().eq("/videoplayback");
|
||||||
let is_android = video_playback && query.get("c").unwrap_or("").eq("ANDROID");
|
let is_android = video_playback && query.get("c").unwrap_or("").eq("ANDROID");
|
||||||
|
let is_web = video_playback && query.get("c").unwrap_or("").eq("WEB");
|
||||||
|
|
||||||
let is_ump = video_playback && query.get("ump").is_some();
|
let is_ump = video_playback && query.get("ump").is_some();
|
||||||
|
|
||||||
|
@ -327,7 +328,7 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
|
||||||
url.set_query(Some(qs.to_string().as_str()));
|
url.set_query(Some(qs.to_string().as_str()));
|
||||||
|
|
||||||
let method = {
|
let method = {
|
||||||
if !is_android && video_playback {
|
if is_web && video_playback {
|
||||||
Method::POST
|
Method::POST
|
||||||
} else {
|
} else {
|
||||||
req.method().clone()
|
req.method().clone()
|
||||||
|
@ -336,7 +337,7 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
|
||||||
|
|
||||||
let mut request = Request::new(method, url);
|
let mut request = Request::new(method, url);
|
||||||
|
|
||||||
if !is_android && video_playback {
|
if is_web && video_playback {
|
||||||
request.body_mut().replace(Body::from("x\0"));
|
request.body_mut().replace(Body::from("x\0"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue