Skip to content

Commit aba23e8

Browse files
authored
feat: add search_with_headers (#948)
This also fixes a API-breaking change to the `search` signature.
1 parent e789df7 commit aba23e8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

crates/cli/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@ impl Rustac {
453453
}
454454
SearchImplementation::Duckdb => stac_duckdb::search(href, search, *max_items)?,
455455
SearchImplementation::Api => {
456-
stac_io::api::search(href, search, *max_items, &headers).await?
456+
stac_io::api::search_with_headers(href, search, *max_items, &headers)
457+
.await?
457458
}
458459
};
459460
self.put(

crates/io/src/api.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ const DEFAULT_CHANNEL_BUFFER: usize = 4;
2020

2121
/// Searches a STAC API.
2222
pub async fn search(
23+
href: &str,
24+
search: Search,
25+
max_items: Option<usize>,
26+
) -> Result<ItemCollection> {
27+
search_with_headers(href, search, max_items, &[]).await
28+
}
29+
30+
/// Searches a STAC API with the provided headers.
31+
pub async fn search_with_headers(
2332
href: &str,
2433
mut search: Search,
2534
max_items: Option<usize>,

0 commit comments

Comments
 (0)