fix: reject malformed host target paths
This commit is contained in:
@@ -440,6 +440,37 @@ fn path_dispatch_is_interface_qualified_and_resolves_once_per_call() {
|
||||
fn call_failures_follow_canonical_precedence_without_execution() {
|
||||
let (_, provider, hidden) = registry_and_provider();
|
||||
|
||||
let resolutions = provider.resolutions.get();
|
||||
for invalid_path in [
|
||||
"relative",
|
||||
"/trailing/",
|
||||
"/double//segment",
|
||||
"/dot/./segment",
|
||||
"/parent/../segment",
|
||||
] {
|
||||
assert_failure(
|
||||
provider
|
||||
.call_operation(request(
|
||||
invalid_path,
|
||||
Some(b"stale"),
|
||||
hidden.reference(),
|
||||
Some(b"stale"),
|
||||
"missing",
|
||||
BTreeMap::new(),
|
||||
))
|
||||
.unwrap_err(),
|
||||
CallErrorKind::InvalidRequest,
|
||||
ProtocolErrorCode::InvalidRequest,
|
||||
);
|
||||
}
|
||||
assert_eq!(provider.resolutions.get(), resolutions);
|
||||
assert_failure(
|
||||
provider.fetch("/invalid/").unwrap_err(),
|
||||
CallErrorKind::InvalidRequest,
|
||||
ProtocolErrorCode::InvalidRequest,
|
||||
);
|
||||
assert_eq!(provider.resolutions.get(), resolutions);
|
||||
|
||||
assert_failure(
|
||||
provider
|
||||
.call_operation(request(
|
||||
|
||||
Reference in New Issue
Block a user