MCPcopy Create free account
hub / github.com/06chaynes/http-cache / response_cache_status

Function response_cache_status

http-cache/src/lib.rs:2032–2039  ·  view source on GitHub ↗

Adds the custom `x-cache` status header to an `http::Response`.

(
    response: &mut Response<B>,
    hit_or_miss: HitOrMiss,
)

Source from the content-addressed store, hash-verified

2030fn response_add_warning<B>(
2031 response: &mut Response<B>,
2032 url: &Url,
2033 code: usize,
2034 message: &str,
2035) {
2036 let host = url_host_str(url);
2037 let escaped_message = message.replace('"', "'").replace(['\n', '\r'], " ");
2038 let value = format!(
2039 "{} {} \"{}\" \"{}\"",
2040 code,
2041 host,
2042 escaped_message,

Callers 3

runMethod · 0.85
conditional_fetchMethod · 0.85
handle_not_modifiedMethod · 0.85

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected