Twelve patches, each breaking one function (the content hash's domain, the root flag, the left-subtree rule, the chunk counter, the component digest check, the Content-Range and content-coding checks, the union, the trailing- byte rule, the missing-digest plan, the class merge, the selection digest test), each naming the cases that must fail. run.sh applies each to a fresh worktree, requires the build, and requires verify to fail naming them; then the Python mutations and the differential. Co-Authored-By: Claude Opus 5.5 <[email protected]>
15 lines
714 B
Diff
15 lines
714 B
Diff
# must fail: object_length_trailing
|
|
# bytes after the envelope are accepted (head::parse_head)
|
|
diff --git a/wai/wai-rs/src/http_binding/head.rs b/wai/wai-rs/src/http_binding/head.rs
|
|
index 1470133d..b861cb16 100644
|
|
--- a/wai/wai-rs/src/http_binding/head.rs
|
|
+++ b/wai/wai-rs/src/http_binding/head.rs
|
|
@@ -101,7 +101,7 @@ pub fn parse_head(prefix: &[u8], envelope_len: u64) -> Result<HeadParse, RangeRe
|
|
}
|
|
};
|
|
let total = head_len + components.iter().map(|c| c.len).sum::<u64>();
|
|
- if total != envelope_len {
|
|
+ if total > envelope_len {
|
|
return Err(RangeRefusal::ObjectLengthMismatch { expected: total, got: envelope_len });
|
|
}
|
|
let bytes = prefix[..head_len as usize].to_vec();
|