open-standards/wai/http-conformance/falsify/dup-caps.patch
Transaction Science 909312ce15 wai: falsification patches for the fix round, and the four the rewrite moved, regenerated
New: threshold-all, refusal-ends, reuse-stale, plus-sign, dispatch-layer,
union-no-layer, wai-prefix-case, dup-caps, record-alt, base-unanswered, each
naming the corpus cases it must fail. accept-gzip, trust-content-range,
skip-on-absent and intersection are the same defects written against the
current code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 09:35:08 -04:00

15 lines
889 B
Diff

# must fail: codecs_dup_alt codecs_dup_plus
# a capability may be named twice (codecs::parse_element)
diff --git a/wai/wai-rs/src/http_binding/codecs.rs b/wai/wai-rs/src/http_binding/codecs.rs
index 530ae822..99f6eba8 100644
--- a/wai/wai-rs/src/http_binding/codecs.rs
+++ b/wai/wai-rs/src/http_binding/codecs.rs
@@ -144,7 +144,7 @@ pub fn parse_element(s: &str) -> Result<Element, CodecsError> {
let alt = Alt { cap, plus: caps.map(str::to_string).collect() };
check_alt(&alt)?;
let repeated_plus = alt.plus.iter().enumerate().any(|(i, p)| alt.plus[..i].contains(p) || *p == alt.cap);
- if repeated_plus || alts.iter().any(|x| x.cap == alt.cap) {
+ if false && (repeated_plus || alts.iter().any(|x| x.cap == alt.cap)) {
return Err(CodecsError::Malformed(format!("{s}: a capability named twice")));
}
alts.push(alt);