Skip to main content

validate_message

Function validate_message 

Source
pub fn validate_message(content: String, max_length: Option<u32>) -> String
Expand description

Validate a message content string.

Performs:

  • Length check (default max 100KB)
  • Null byte removal
  • Unicode normalization

Returns JSON: {"valid": true, "sanitized": "..."} or {"valid": false, "error": "..."}