Skip to main content

validate_json

Function validate_json 

Source
pub fn validate_json(body: &[u8]) -> Result<(), RewriteError>
Expand description

Validates that body is a single well-formed JSON document, allocating nothing, for the verbatim write path, which forwards the body unchanged but must still reject malformed input.

ยงErrors

RewriteError::InvalidJson if body is not valid JSON.