mirror of
https://github.com/perstarkse/minne.git
synced 2026-07-02 11:01:38 +02:00
chore: improve html-router auth, caching, and analytics while centralizing search labels in common.
small fix
This commit is contained in:
@@ -29,7 +29,10 @@ pub fn validate_ingest_input(
|
||||
category: &str,
|
||||
file_count: usize,
|
||||
) -> Result<(), IngestValidationError> {
|
||||
let text_field_bytes = content.map(str::len).unwrap_or(0) + ctx.len() + category.len();
|
||||
let content_bytes = content.map_or(0, str::len);
|
||||
let text_field_bytes = content_bytes
|
||||
.saturating_add(ctx.len())
|
||||
.saturating_add(category.len());
|
||||
if text_field_bytes > config.ingest_max_body_bytes {
|
||||
return Err(IngestValidationError::PayloadTooLarge(format!(
|
||||
"request text fields exceed maximum allowed body size of {} bytes",
|
||||
|
||||
Reference in New Issue
Block a user