feat: add optional allow_binary parameter to item handlers

Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-13 13:25:27 -03:00
parent 07ea7ec5a4
commit 243e77fba4
2 changed files with 19 additions and 8 deletions

View File

@@ -69,6 +69,8 @@ pub struct ItemContentInfo {
#[derive(Debug, Deserialize)]
pub struct TagsQuery {
pub tags: Option<String>,
#[serde(default)]
pub allow_binary: bool,
}
#[derive(Debug, Deserialize)]
@@ -79,6 +81,12 @@ pub struct ListItemsQuery {
pub count: Option<u32>,
}
#[derive(Debug, Deserialize)]
pub struct ItemQuery {
#[serde(default)]
pub allow_binary: bool,
}
fn check_bearer_auth(auth_str: &str, expected_password: &str) -> bool {
auth_str.starts_with("Bearer ") && &auth_str[7..] == expected_password
}