kutil_http/headers/
conditional.rs1use super::{date::*, headers::*};
2
3use http::*;
4
5pub fn modified(request_headers: &HeaderMap, response_headers: &HeaderMap) -> bool {
9 if let Some(if_none_match) = request_headers.if_none_match() {
12 if if_none_match.matches(response_headers.etag().as_ref()) {
15 tracing::debug!("not modified (If-None-Match)");
16 return false;
17 }
18 }
19
20 if !modified_since(response_headers.last_modified(), request_headers.if_modified_since()) {
21 tracing::debug!("not modified (If-Modified-Since)");
22 return false;
23 }
24
25 true
29}