Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(skills): correct URL validation to allow trailing slash

Steven Enamakel4467a3fcd7b9
diff --git a/crates/openhuman-core/src/skills/ops.rs b/crates/openhuman-core/src/skills/ops.rs
index 3a2d1c8a7f..aba91e6e32 100644
--- a/crates/openhuman-core/src/skills/ops.rs
+++ b/crates/openhuman-core/src/skills/ops.rs
@@ -52,7 +52,7 @@ pub(crate) use super::ops_create::create_workflow_inner;
pub(crate) use super::ops_discover::discover_workflows_inner;
#[cfg(test)]
pub(crate) use super::ops_install::{
- derive_install_slug, install_workflow_from_url_with_home, normalize_install_url,
+ install_workflow_from_url_with_home, normalize_install_url,
should_report_install_fetch_status,
};
#[cfg(test)]
diff --git a/crates/openhuman-core/src/skills/ops_create_and_url_tests.rs b/crates/openhuman-core/src/skills/ops_create_and_url_tests.rs
index 5ec643d159..6e3393540c 100644
--- a/crates/openhuman-core/src/skills/ops_create_and_url_tests.rs
+++ b/crates/openhuman-core/src/skills/ops_create_and_url_tests.rs
@@ -296,6 +296,25 @@ fn create_skill_rejects_empty_description() {
);
}
+// -- install URL host policy (portable guards are tested in tinyskills) ------
+
+#[test]
+fn normalize_install_url_accepts_a_file_api_that_names_the_md_in_its_query() {
+ let url = "https://clawhub.ai/api/v1/skills/apple-design/file?path=SKILL.md";
+ assert_eq!(normalize_install_url(url).unwrap(), url);
+ let err =
+ normalize_install_url("https://clawhub.ai/api/v1/skills/x/file?path=run.sh").unwrap_err();
+ assert!(err.contains(".md"), "{err}");
+ // Only ClawHub's file endpoint may name the file in its query.
+ for other in [
+ "https://example.com/api/v1/skills/x/file?path=SKILL.md",
+ "https://clawhub.ai/download?path=SKILL.md",
+ ] {
+ let err = normalize_install_url(other).unwrap_err();
+ assert!(err.contains(".md"), "{other}: {err}");
+ }
+}
+
#[tokio::test]
async fn install_workflow_from_url_is_idempotent_when_skill_already_exists() {
use wiremock::matchers::{method, path};