Skip to main content

check_conditional

Function check_conditional 

Source
pub fn check_conditional(
    req: &Request<impl Body>,
    current_etag: &str,
    current_last_modified: &str,
) -> ConditionalResult
Expand description

Checks If-None-Match and If-Modified-Since headers against the current ETag and Last-Modified values.

Only a GET or HEAD is answered 304 (RFC 9110 §13.1.2, §13.1.3); any other method gets SendFull. When If-None-Match is present, all of its lines are read and If-Modified-Since is ignored, even if no line is readable. Until 2026-10-13 a request of any method was answered 304, only the first If-None-Match line was read, and one that was not visible ASCII fell through to the date.