From 87bb23f3be322b936e8c1a52a4d3efa7cf8ec96b Mon Sep 17 00:00:00 2001 From: Brian <18603393+brian6932@users.noreply.github.com> Date: Sat, 3 Feb 2024 18:06:16 -0500 Subject: [PATCH] Add `platform` to `permitted_incoming_keys` --- src/main.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7068d7b..1c6620b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ use std::borrow::Cow; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; use std::net::{IpAddr, SocketAddr}; #[cfg(feature = "tls")] use std::path::PathBuf; @@ -364,24 +364,25 @@ pub(crate) async fn process(pd: ProcessData, state: &LState) -> AppResult Result { - const PERMITTED_INCOMING_KEYS: [&str; 11] = [ + let permitted_incoming_keys: HashSet<&str> = HashSet::from([ "player_backend", // mediaplayer "playlist_include_framerate", // true "reassignments_supported", // true - "supported_codecs", // avc1, usually. sometimes vp09,avc1 + "supported_codecs", // av1,h265,h264 "cdm", // wv - "player_version", // 1.20.0 + "player_version", // 1.24.0-rc.1.3 "fast_bread", // true; related to low latency mode "allow_source", // true "allow_audio_only", // true "warp", // true; https://github.com/kixelated/warp-draft "transcode_mode", // cbr_v1 - ]; + "platform", // web + ]); let mut url = Url::parse(&pd.sid.get_url())?; // set query string automatically using non-identifying parameters url.query_pairs_mut().extend_pairs( - pd.query.iter().filter(|(k, _)| PERMITTED_INCOMING_KEYS.contains(&k.as_ref())), + pd.query.iter().filter(|(k, _)| permitted_incoming_keys.contains(&k.as_ref())), ); // add our fake ID url.query_pairs_mut()