Seal the fetch target: one value holds the URL and its host

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-22 23:03:49 -07:00
parent f095cca1ee
commit bf9e79ac21
5 changed files with 53 additions and 21 deletions
+2 -2
View File
@@ -404,12 +404,12 @@ fn covers(args: &ToolArgs, grant: &Grant) -> Option<Option<String>> {
}
}
ToolArgs::Shell { cwd: Some(cwd), .. } => best_path(grant, cwd, true),
ToolArgs::HttpFetch { host, .. } => {
ToolArgs::HttpFetch(target) => {
if grant
.constraints
.hosts
.iter()
.any(|pattern| host_matches(pattern, host))
.any(|pattern| host_matches(pattern, target.host()))
{
Some(None)
} else {