kvarn_utils::parse

Struct CriticalRequestComponents

source
pub struct CriticalRequestComponents { /* private fields */ }
Expand description

Critical components from request to apply to response.

Implementations§

source§

impl CriticalRequestComponents

source

pub fn apply_to_response( &self, response: &mut Response<Bytes>, overriden_len: Option<u64>, is_stream: bool, ) -> Result<(), SanitizeError>

Applies the critical components’ info to the response.

For now applies range and replaces the accept-ranges header. IF is_stream is false, else ranges aren’t supported and we cancel.

§Errors

Will return a SanitizeError::RangeNotSatisfiable if the start of the range is greater than the length of the body.

source

pub fn get_r