[core] Share paths and errors: refuse overlong UTF-8, %u, look-alike dots and slashes and trimmed dot segments; never repeat URL credentials in an error
This commit is contained in:
@@ -422,7 +422,9 @@ fn rejects_bad_upstream_urls() {
|
||||
] {
|
||||
let e = single_error(&format!("hostname = \"app.test\"\nupstreams = [{bad:?}]\n"));
|
||||
assert!(
|
||||
matches!(e, ValidationError::BadUpstreamUrl { ref url, .. } if url == bad),
|
||||
// Credentials are never repeated in an error.
|
||||
matches!(e, ValidationError::BadUpstreamUrl { ref url, .. }
|
||||
if url == bad || (bad.contains('@') && url == "http://\u{2026}@127.0.0.1:8080")),
|
||||
"upstream {bad:?} gave {e:?}"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user