Skip to main content

validate_file_content

Function validate_file_content 

Source
pub fn validate_file_content(
    content: &[u8],
    expected_text: bool,
) -> Result<(), ValidationError>
Expand description

Validate that file content is not malicious or malformed

Basic security checks for file content integrity:

  • Minimum size requirements
  • Binary content detection for text formats
  • Basic malformation checks

ยงErrors

Returns ValidationError::InvalidFileContent if the content is too small, contains unexpected binary data for text formats, or fails UTF-8 validation.