diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index 87e6ea48..01a45dce 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -453,7 +453,8 @@ impl Rustac { } SearchImplementation::Duckdb => stac_duckdb::search(href, search, *max_items)?, SearchImplementation::Api => { - stac_io::api::search(href, search, *max_items, &headers).await? + stac_io::api::search_with_headers(href, search, *max_items, &headers) + .await? } }; self.put( diff --git a/crates/io/src/api.rs b/crates/io/src/api.rs index ca42cc24..5a9949f9 100644 --- a/crates/io/src/api.rs +++ b/crates/io/src/api.rs @@ -20,6 +20,15 @@ const DEFAULT_CHANNEL_BUFFER: usize = 4; /// Searches a STAC API. pub async fn search( + href: &str, + search: Search, + max_items: Option, +) -> Result { + search_with_headers(href, search, max_items, &[]).await +} + +/// Searches a STAC API with the provided headers. +pub async fn search_with_headers( href: &str, mut search: Search, max_items: Option,