15 lines
954 B
Diff
15 lines
954 B
Diff
# must fail: fetch_O10L1_declared_no_base
|
|
# a layer is declared with no base held (codecs::check_declared)
|
|
diff --git a/wai/wai-rs/src/http_binding/codecs.rs b/wai/wai-rs/src/http_binding/codecs.rs
|
|
index 568a3c5a..40a04044 100644
|
|
--- a/wai/wai-rs/src/http_binding/codecs.rs
|
|
+++ b/wai/wai-rs/src/http_binding/codecs.rs
|
|
@@ -392,7 +392,7 @@ pub fn check_declared(head: &Head, union: &Element, base: Option<&SeqObject>) ->
|
|
.and_then(|v| Refines::from_value(v, RefForm::ContentHash).ok())
|
|
.and_then(|r| super::unhex32(&r.base))
|
|
.ok_or_else(undeclared)?;
|
|
- let base_cap = base.and_then(|b| base_capability(b, &refines)).ok_or_else(undeclared)?;
|
|
+ let Some(base_cap) = base.and_then(|b| base_capability(b, &refines)) else { return Ok(()) };
|
|
return if union.alts.iter().any(|a| a.cap == base_cap && a.plus.contains(&cap)) { Ok(()) } else { Err(undeclared()) };
|
|
}
|
|
let e = element_of(head)?;
|