24 lines
1.3 KiB
Diff
24 lines
1.3 KiB
Diff
# must fail: playlist_receipt_ceiling_past_2_53 playlist_receipt_ceiling_written_out playlist_receipt_window_past_2_53
|
|
# numbers past 2^53 - 1 read (ManifestReceipt::from_json)
|
|
diff --git a/wai/wai-rs/src/wai_video_manifest.rs b/wai/wai-rs/src/wai_video_manifest.rs
|
|
index a7574e49..60e021ee 100644
|
|
--- a/wai/wai-rs/src/wai_video_manifest.rs
|
|
+++ b/wai/wai-rs/src/wai_video_manifest.rs
|
|
@@ -186,7 +186,7 @@ pub const MAX_FILE_NUMBER: u64 = (1 << 53) - 1;
|
|
fn numbers_within(v: &serde_json::Value) -> bool {
|
|
use serde_json::Value;
|
|
match v {
|
|
- Value::Number(n) => n.as_u64().is_some_and(|x| x <= MAX_FILE_NUMBER),
|
|
+ Value::Number(n) => n.as_u64().is_some(),
|
|
Value::Array(a) => a.iter().all(numbers_within),
|
|
Value::Object(o) => o.values().all(numbers_within),
|
|
_ => true,
|
|
@@ -211,7 +211,7 @@ pub fn grant_from_json(v: &serde_json::Value) -> Result<GrantRef, String> {
|
|
let ceiling = |k: &str| -> Result<Option<u64>, String> {
|
|
match g.get(k) {
|
|
Some(Value::Null) => Ok(None),
|
|
- Some(n) => n.as_u64().filter(|&x| x <= MAX_FILE_NUMBER).map(Some).ok_or(format!("grant.{k} is a number of at most 2^53 - 1, or null")),
|
|
+ Some(n) => n.as_u64().map(Some).ok_or(format!("grant.{k} is a number of at most 2^53 - 1, or null")),
|
|
None => Err(format!("grant.{k}")),
|
|
}
|
|
};
|