open-standards/wai/http-conformance/falsify/skip-digest.patch
Transaction Science 1cddbdad19 wai: http-conformance falsification patches and their runner
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]>
2026-10-05 07:52:43 -04:00

15 lines
742 B
Diff

# must fail: fetch_O7
# a fetched component is not checked against its sha256 (session::check_component)
diff --git a/wai/wai-rs/src/http_binding/session.rs b/wai/wai-rs/src/http_binding/session.rs
index 05e6cb08..7d4e3b38 100644
--- a/wai/wai-rs/src/http_binding/session.rs
+++ b/wai/wai-rs/src/http_binding/session.rs
@@ -181,7 +181,7 @@ pub fn check_response(req: Option<ByteRange>, r: &ResponseMeta, body_len: u64, e
/// Whether `bytes` match entry `index`'s `sha256` in `m`; false when it states none.
fn check_component(m: &ManifestV2, index: usize, bytes: &[u8]) -> bool {
- m.renditions.get(index).is_some_and(|e| e.sha256.is_some() && e.payload_digest_matches(bytes))
+ m.renditions.get(index).is_some()
}
enum Stage {