feat: add as_meta parameter to content endpoint

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-28 17:57:50 -03:00
parent 2ab0ed1938
commit 729d7a060b
2 changed files with 143 additions and 6 deletions

View File

@@ -130,6 +130,8 @@ pub struct ItemQuery {
pub length: u64,
#[serde(default = "default_stream")]
pub stream: bool,
#[serde(default = "default_as_meta")]
pub as_meta: bool,
}
#[derive(Debug, Deserialize, utoipa::ToSchema)]
@@ -143,6 +145,8 @@ pub struct ItemContentQuery {
pub length: u64,
#[serde(default = "default_stream")]
pub stream: bool,
#[serde(default = "default_as_meta")]
pub as_meta: bool,
}
fn check_bearer_auth(auth_str: &str, expected_password: &str, expected_hash: &Option<String>) -> bool {
@@ -169,6 +173,10 @@ fn default_stream() -> bool {
false
}
fn default_as_meta() -> bool {
false
}
fn check_basic_auth(auth_str: &str, expected_password: &str, expected_hash: &Option<String>) -> bool {
if !auth_str.starts_with("Basic ") {
return false;