Skip to content

Commit

Permalink
Trim whitespace from fields, in case frontend javascript didn't do so
Browse files Browse the repository at this point in the history
  • Loading branch information
emarsden committed Feb 26, 2024
1 parent cc717f2 commit c9daf34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,26 @@ pub fn generate_widevine_pssh_b64(
pssh.add_key_id(kid);
}
if let PsshData::Widevine(ref mut pd) = pssh.pssh_data {
let provider = provider.trim();
if !provider.is_empty() {
pd.provider = Some(String::from(provider));
}
let content_id = content_id.trim();
if !content_id.is_empty() {
if let Ok(ci) = hex::decode(content_id) {
pd.content_id = Some(ci);
} else {
return Err(PsshBoxWasmError::InvalidHex(String::from("content_id")).into());
}
}
let policy = policy.trim();
if !policy.is_empty() {
pd.policy = Some(String::from(policy));
}
if let Some(cpi) = crypto_period_index {
pd.crypto_period_index = Some(cpi);
}
let protection_scheme = protection_scheme.trim();
if !protection_scheme.is_empty() {
if let Some(ps) = ProtectionScheme::from_str_name(protection_scheme) {
pd.protection_scheme = Some(ps.into());
Expand Down
2 changes: 1 addition & 1 deletion www-zola/content/decode.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ following <abbr title="Digital Rights Management">DRM</abbr> systems:
- <a href="https://irdeto.com/video-entertainment/multi-drm/">Irdeto</a>
- <a href="https://www.marlin-community.com/">Marlin</a>
- <a href="https://developer.huawei.com/consumer/en/hms/huawei-wiseplay/">WisePlay</a>, owned by Huawei
- The unofficial variant of Apple Fairplay that is used for DASH-like streaming by Netflix
- The unofficial variant of Apple FairPlay that is used for DASH-like streaming by Netflix
- Common Encryption (CENC)


Expand Down

0 comments on commit c9daf34

Please sign in to comment.