[core] Schema: host file model and validation with typed errors
This commit is contained in:
@@ -397,7 +397,8 @@ fn rejects_invalid_header_names() {
|
||||
#[test]
|
||||
fn rejects_invalid_header_values() {
|
||||
for bad in ["a\nb", "a\rb", "a\u{0}b", "{http.request.host}", "x}", "\u{7f}", " leading", "ü"] {
|
||||
let e = single_error(&rule("response_headers", &format!("action = \"set\"\nname = \"X-A\"\nvalue = {bad:?}")));
|
||||
let value = toml::Value::String(bad.to_owned()).to_string();
|
||||
let e = single_error(&rule("response_headers", &format!("action = \"set\"\nname = \"X-A\"\nvalue = {value}")));
|
||||
assert!(matches!(e, ValidationError::InvalidHeaderValue { .. }), "{bad:?}: {e:?}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user