Adds the custom `x-cache` status header to an `http::Response`.
(
response: &mut Response<B>,
hit_or_miss: HitOrMiss,
)
| 2030 | fn 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, |
no test coverage detected